lkml.org 
[lkml]   [2000]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectmmap() question
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 majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:41    [W:0.028 / U:12.632 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site