Re: failed shared mmap'ing of /dev/zero

David S. Miller (davem@caip.rutgers.edu)
Thu, 14 Mar 1996 06:39:28 -0500


Date: Wed, 13 Mar 1996 12:32:35 -0800
From: Sean Foderaro <jkf@tiger.franz.com>

/dev/zero in linux refuses to do a MAP_SHARED mmap if PROT_WRITE
is also given.

Other Unixes (sunos, solaris, irix. ...) have no problem with this.

Why would you want to do this kind of mapping? Well, I'm trying
to port some code that, needs to determine the location where shared
writable segments will be placed in the address space.

As a matter of fact, SunOS ld.so does this to map in the bss section
of a shared library. I detect this case, change it to a MAP_ANONYMOUS
and it seems to work for me. Maybe I'm missing something...

Later,
David S. Miller
davem@caip.rutgers.edu