linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmap.2: MAP_FIXED is no longer discouraged
@ 2017-12-02  2:16 john.hubbard-Re5JQEeQqe8AvxtiuMwx3w
  2017-12-02 15:05 ` Matthew Wilcox
  0 siblings, 1 reply; 6+ messages in thread
From: john.hubbard-Re5JQEeQqe8AvxtiuMwx3w @ 2017-12-02  2:16 UTC (permalink / raw)
  To: Michael Kerrisk
  Cc: linux-man, linux-api-u79uwXL29TY76Z2rM5mHXA, Michael Ellerman,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg, LKML,
	linux-arch-u79uwXL29TY76Z2rM5mHXA, Michal Hocko, John Hubbard

From: John Hubbard <jhubbard-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

MAP_FIXED has been widely used for a very long time, yet the man
page still claims that "the use of this option is discouraged".

The documentation assumes that "less portable" == "must be discouraged".

Instead of discouraging something that is so useful and widely used,
change the documentation to explain its limitations better.

Signed-off-by: John Hubbard <jhubbard-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
While reviewing Michal Hocko's man page update for MAP_FIXED_SAFE,
I noticed that MAP_FIXED was no longer reflecting the current
situation, so here is a patch to bring it into the year 2017.

 man2/mmap.2 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/man2/mmap.2 b/man2/mmap.2
index 385f3bfd5..a5a8eb47a 100644
--- a/man2/mmap.2
+++ b/man2/mmap.2
@@ -222,8 +222,10 @@ part of the existing mapping(s) will be discarded.
 If the specified address cannot be used,
 .BR mmap ()
 will fail.
-Because requiring a fixed address for a mapping is less portable,
-the use of this option is discouraged.
+Software that aspires to be portable should use this option with care, keeping
+in mind that the exact layout of a process' memory map is allowed to change
+significantly between kernel versions, C library versions, and operating system
+releases.
 .TP
 .B MAP_GROWSDOWN
 This flag is used for stacks.
-- 
2.15.1

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-12-03  4:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-02  2:16 [PATCH] mmap.2: MAP_FIXED is no longer discouraged john.hubbard-Re5JQEeQqe8AvxtiuMwx3w
2017-12-02 15:05 ` Matthew Wilcox
2017-12-02 18:49   ` Jann Horn
     [not found]     ` <CAG48ez2u3fjBDCMH4x3EUhG6ZD6VUa=A1p441P9fg=wUdzwHNQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-12-02 22:19       ` Matthew Wilcox
     [not found]         ` <20171202221910.GA8228-PfSpb0PWhxZc2C7mugBRk2EX/6BAtgUQ@public.gmane.org>
2017-12-03  0:22           ` John Hubbard
2017-12-03  4:06           ` John Hubbard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).