Re: mmap() question

2000-10-25 Thread Andi Kleen

On Wed, Oct 25, 2000 at 10:19:23AM +0200, Gábor Lénárt wrote:
> I'm totally confused.
> Can someone help, please ?

Shared anonymous mappings are not supported in 2.2. You need some file
to back it.


-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



mmap() question

2000-10-25 Thread Gábor Lénárt

Hi,

Sorry for my stupid question, but I haven't got idea what the problem can be,
and maybe you can help me. See the following fragment of C code:

videobuffer=mmap(0,MAX_VIDEO_PACKET_SIZE,PROT_READ|PROT_WRITE,MAP_ANON|MAP_SHARED,-1,0);
if (videobuffer==(void*)-1) {
perror("mmap()");
exit(1);
}

This will return with Invalid argument.
The nice this is that this code runs happyly with 2.4.x-pre kernels but not
with my 2.2.17 or 2.2.18pre15.

Maybe because of not page aligned size, so I modify my code:
I defined MAX_VIDEO_PACKET_SIZE to 4096 for testing (on PC page size is
4096 bytes, and getpagesize() returns with this as well, I checked).

The result is the same ! I don't understand what the problem can be ...

I tried with opening /dev/zero with O_RDWR mode than mapping that, but that
gave me the same result ;-(

I'm totally confused.
Can someone help, please ?

- Gabor

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



mmap() question

2000-10-25 Thread Gbor Lnrt

Hi,

Sorry for my stupid question, but I haven't got idea what the problem can be,
and maybe you can help me. See the following fragment of C code:

videobuffer=mmap(0,MAX_VIDEO_PACKET_SIZE,PROT_READ|PROT_WRITE,MAP_ANON|MAP_SHARED,-1,0);
if (videobuffer==(void*)-1) {
perror("mmap()");
exit(1);
}

This will return with Invalid argument.
The nice this is that this code runs happyly with 2.4.x-pre kernels but not
with my 2.2.17 or 2.2.18pre15.

Maybe because of not page aligned size, so I modify my code:
I defined MAX_VIDEO_PACKET_SIZE to 4096 for testing (on PC page size is
4096 bytes, and getpagesize() returns with this as well, I checked).

The result is the same ! I don't understand what the problem can be ...

I tried with opening /dev/zero with O_RDWR mode than mapping that, but that
gave me the same result ;-(

I'm totally confused.
Can someone help, please ?

- Gabor

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/