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.