mmap(2): MAP_ANON
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 16 lines · Heinrich Schuchardt
Hello Michael,
in the mmap(2) man page
MAP_ANONis described as deprecated.When I look at the NetBSD manpage
http://netbsd.gw.com/cgi-bin/man-cgi?mmap+2+NetBSD-current
I found thatMAP_ANONYMOUSis not defined.https://www.dragonflybsd.org/cgi/web-man?command=mmap§ion=2
indicatesMAP_ANONYMOUSis an alias forMAP_ANONand is provided for compatibility.https://man.openbsd.org/mmap.2 also knows
MAP_ANONYMOUSas a synonym.https://www.unix.com/man-page/osx/2/mmap/ does not know
MAP_ANONYMOUS.
Quoted 7 lines
So shouldn't the man page indicate that
MAP_ANONis to be favored to write portable code? And correspondingly markMAP_ANONYMOUSas synonym only kept for compatibility.The Open Group Base Specifications Issue 7, 2018 Edition does not reference either of both. So both values are not POSIX but it is not correct to describe them as Linux only.
The text saying that MAP_ANON is deprecated is ancient (at least 20 years old). I don't know why that text was added.
Things are not simple though: it looks like there's at least one historical implementation (HP-US) that defines MAP_ANONYMOUS but not MAP_ANON.
I've applied the patch below.
Thanks,
Michael
Signature · 3 lines
Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/
Quoted 25 lines · Michael Kerrisk (man-pages)
Quoted 16 lines · Heinrich Schuchardt
Hello Michael,
in the mmap(2) man page
MAP_ANONis described as deprecated.When I look at the NetBSD manpage
http://netbsd.gw.com/cgi-bin/man-cgi?mmap+2+NetBSD-current
I found thatMAP_ANONYMOUSis not defined.https://www.dragonflybsd.org/cgi/web-man?command=mmap§ion=2
indicatesMAP_ANONYMOUSis an alias forMAP_ANONand is provided for compatibility.https://man.openbsd.org/mmap.2 also knows
MAP_ANONYMOUSas a synonym.https://www.unix.com/man-page/osx/2/mmap/ does not know
MAP_ANONYMOUS.Quoted 7 lines
So shouldn't the man page indicate that
MAP_ANONis to be favored to write portable code? And correspondingly markMAP_ANONYMOUSas synonym only kept for compatibility.The Open Group Base Specifications Issue 7, 2018 Edition does not reference either of both. So both values are not POSIX but it is not correct to describe them as Linux only.
Quoted 8 lines
The text saying that
MAP_ANONis deprecated is ancient (at least 20 years old). I don't know why that text was added.Things are not simple though: it looks like there's at least one historical implementation (HP-US) that defines
MAP_ANONYMOUSbut notMAP_ANON.I've applied the patch below.
Somehow the patch got lost in the mail. Couldn't identify it upstream
(https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git) either.
Best regards
Heinrich
Quoted 4 lines
Thanks,
Michael
Quoted 4 lines
Quoted 1 line
I've applied the patch below.
Somehow the patch got lost in the mail. Couldn't identify it upstream
(https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git) either.
Ooops. This time...
Cheers,
Michael
man2/mmap.2 +2 -2
@@ -193,8 +193,8 @@ is set. .TP .B MAP_ANON Synonym for -.BR MAP_ANONYMOUS . -Deprecated. +.BR MAP_ANONYMOUS ; +provided for compatibility with other implementations. .TP .B MAP_ANONYMOUS The mapping is not backed by any file;
Signature · 3 lines
Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/