From 3ee0a7f07ed1bd607e598bc4477af0dea5db4084 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Sun, 26 Aug 2018 13:14:33 +0200 Subject: [PATCH] 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 --- man2/mmap.2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/man2/mmap.2 b/man2/mmap.2 index 3d3d1882f..7ca39ff5d 100644 --- a/man2/mmap.2 +++ b/man2/mmap.2 @@ -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