From 56a033affa4095c37b87f54e6b6a6a48529bb950 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Fri, 13 Apr 2018 08:50:38 +0200 Subject: [PATCH] mmap.2: Minor wording fixes to to text describing MAP_FIXED hazards Signed-off-by: Michael Kerrisk --- man2/mmap.2 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/man2/mmap.2 b/man2/mmap.2 index 2d727a764..68a472dad 100644 --- a/man2/mmap.2 +++ b/man2/mmap.2 @@ -249,11 +249,16 @@ If the specified address cannot be used, .BR mmap () will fail. .IP -Software that aspires to be portable should use this option with care, +Software that aspires to be portable should use the +.BR MAP_FIXED +flag with care, keeping in mind that the exact layout of a process's memory mappings is allowed to change significantly between kernel versions, C library versions, and operating system releases. -This option should be used only when the specified memory region has +.IP +The +.BR MAP_FIXED +flag should be used only when the specified memory region has already been reserved using another mapping; otherwise, it is extremely hazardous because it forcibly removes preexisting mappings, making it easy for a multithreaded process to corrupt its own address space.