Date: Thu, 05 Nov 2009 12:03:35 -0600 From: Alan Cox <alc@cs.rice.edu> To: Alexander Best <alexbestms@math.uni-muenster.de> Cc: alc@freebsd.org, Ed Schouten <ed@80386.nl>, freebsd-hackers@freebsd.org Subject: Re: mmap(2) with MAP_ANON honouring offset although it shouldn't Message-ID: <4AF31377.60405@cs.rice.edu> In-Reply-To: <permail-20091104190925f0889e84000041f8-a_best01@message-id.uni-muenster.de> References: <permail-20091104190925f0889e84000041f8-a_best01@message-id.uni-muenster.de>
next in thread | previous in thread | raw e-mail | index | archive | help
Alexander Best wrote: > Alan Cox schrieb am 2009-11-04: > >> Ed Schouten wrote: >> >>> * Alan Cox <alc@cs.rice.edu> wrote: >>> > > >> For what it's worth, I believe that Solaris does the exact opposite. >> >>>> They provide MAP_ANONYMOUS for compatibility. It seems like a good >>>> idea for us to do the same. >>>> > > > >>> Something like this? >>> > > >>> Index: mman.h >>> =================================================================== >>> --- mman.h (revision 198919) >>> +++ mman.h (working copy) >>> @@ -82,6 +82,9 @@ >>> */ >>> #define MAP_FILE 0x0000 /* map from file (default) */ >>> #define MAP_ANON 0x1000 /* allocated from memory, >>> swap space */ >>> +#ifndef _KERNEL >>> +#define MAP_ANONYMOUS MAP_ANON /* For compatibility. */ >>> +#endif /* !_KERNEL */ >>> /* >>> * Extended flags >>> > > > > >> Yes. If no one objects in the next day or so, then please commit >> this change. >> > > >> Alan >> > > should this compatibility addition be documented in the mmap(2) manual? > > I don't have a strong opinion one way or the other, but I would lean toward "yes". That said, Solaris doesn't. > any thoughts on the previous change request so mmap fails with MAP_ANON and > pos=0? > > Unfortunately, no. My FreeBSD time for the last few days has been spent looking into some anomalies in wiring memory and writing breakpoints. Alan
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4AF31377.60405>