> Date: Mon, 30 Jun 2014 10:53:00 -0700 > From: Matthew Dempsky <[email protected]> > > On Mon, Jun 30, 2014 at 10:42 AM, Mark Kettenis <[email protected]> > wrote: > > Solaris documents MAP_ANON in its man page, and defines MAP_ANONYMOUS > > as MAP_ANON for source compatibility. > > Yep, but what about it? Are you suggesting that should affect POSIX's > standardization, or that we should do the same thing? I suspect if > POSIX standardizes MAP_ANONYMOUS, that Solaris would switch to > documenting MAP_ANONYMOUS and providing MAP_ANON for source compat, > no?
Yes, I'm saying that this should affect POSIX's standardization. Solaris is where mmap(2) came from. Also, look at: <https://github.com/sgminer-dev/sgminer/blob/master/m4/mmap-anon.m4> which contains the following comment: # Detect how mmap can be used to create anonymous (not file-backed) memory # mappings. # - On Linux, AIX, OSF/1, Solaris, Cygwin, Interix, Haiku, both MAP_ANONYMOUS # and MAP_ANON exist and have the same value. # - On HP-UX, only MAP_ANONYMOUS exists. # - On MacOS X, FreeBSD, NetBSD, OpenBSD, only MAP_ANON exists. # - On IRIX, neither exists, and a file descriptor opened to /dev/zero must be # used. This suggests that there is actually a clear majority of systems where only MAP_ANON exists. OK, UnixWare isn't listed here, and perhaps it doesn't provide MAP_ANON for compatibility. But frankly, UnixWare is long dead. Perhaps a few more systems in the "only MAP_ANON exists" category have moved up to the the "both MAP_ANONYMOUS and MAP_ANON" exist category. But MacOS X 10.6 is still firmly in the "only MAP_ANON exists" category. And I'd say MacOS X has a much larger installed base than HP-UX. Regardless of what POSIX decides, I think we should add MAP_ANONYMOUS, but stay true to our heritage and keep MAP_ANON as the primary #define and in the man page.
