mmap.2: Explicitly state that the fd can be closed

I regularly see excessive fd usage bugs (or even leaks) caused by
people who think they need to keep the fd open as long as the
mapping exists.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Elliott Hughes 2018-08-26 13:14:33 +02:00 committed by Michael Kerrisk
parent dc9b6c9285
commit 3ee0a7f07e
1 changed files with 2 additions and 0 deletions

View File

@ -87,6 +87,8 @@ in the file (or other object) referred to by the file descriptor
.I offset
must be a multiple of the page size as returned by
.IR sysconf(_SC_PAGE_SIZE) .
The file descriptor can be closed immediately without invalidating the
mapping.
.PP
The
.I prot