From e3e22b2b2b50829191e93e05653fc3651171b8dc Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Sun, 21 Mar 2021 16:32:20 +0100 Subject: [PATCH] close_range.2: Correct the explanation of the EMFILE error close_range() CLOSE_RANGE_USHARE triggers a call to dup_fd() which in turn calls alloc_fdtable(), which checks that sysctl_nr_open has not been exceeded. Signed-off-by: Michael Kerrisk --- man2/close_range.2 | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/man2/close_range.2 b/man2/close_range.2 index b6b6c2a9e..ff4b81aaa 100644 --- a/man2/close_range.2 +++ b/man2/close_range.2 @@ -79,11 +79,16 @@ The following can occur with (when constructing the new descriptor table): .TP .B EMFILE -The per-process limit on the number of open file descriptors has been reached -(see the description of -.B RLIMIT_NOFILE -in -.BR getrlimit (2)). +The number of open file descriptors exceeds the limit specified in +.IR /proc/sys/fs/nr_open +(see +.BR proc (5)). +This error can occur in situations where that limit was lowered before +a call to +.BR close_range () +where the +.B CLOSE_RANGE_UNSHARE +flag is specified. .TP .B ENOMEM Insufficient kernel memory was available.