summaryrefslogtreecommitdiffstats
path: root/upstream/archlinux/man2/close_range.2
diff options
context:
space:
mode:
Diffstat (limited to 'upstream/archlinux/man2/close_range.2')
-rw-r--r--upstream/archlinux/man2/close_range.216
1 files changed, 10 insertions, 6 deletions
diff --git a/upstream/archlinux/man2/close_range.2 b/upstream/archlinux/man2/close_range.2
index 017f95f9..738bf8f7 100644
--- a/upstream/archlinux/man2/close_range.2
+++ b/upstream/archlinux/man2/close_range.2
@@ -3,7 +3,7 @@
.\"
.\" SPDX-License-Identifier: Linux-man-pages-copyleft
.\"
-.TH close_range 2 2023-10-31 "Linux man-pages 6.06"
+.TH close_range 2 2024-05-02 "Linux man-pages 6.8"
.SH NAME
close_range \- close all file descriptors in a given range
.SH LIBRARY
@@ -11,10 +11,14 @@ Standard C library
.RI ( libc ", " \-lc )
.SH SYNOPSIS
.nf
-.B #include <linux/close_range.h>
+.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
+.B #include <unistd.h>
.P
-.BI "int close_range(unsigned int " first ", unsigned int " last ,
-.BI " unsigned int " flags );
+.BR "#include <linux/close_range.h>" " /* Definition of " CLOSE_RANGE_*
+.BR "" " constants */"
+.P
+.BI "int close_range(unsigned int " first ", unsigned int " last \
+", int " flags );
.fi
.SH DESCRIPTION
The
@@ -205,7 +209,7 @@ result from the calls to
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
-#include <sys/syscall.h>
+#include <sys/types.h>
#include <unistd.h>
\&
/* Show the contents of the symbolic links in /proc/self/fd */
@@ -259,7 +263,7 @@ main(int argc, char *argv[])
\&
printf("========= About to call close_range() =======\en");
\&
- if (syscall(SYS_close_range, 3, \[ti]0U, 0) == \-1) {
+ if (close_range(3, \[ti]0U, 0) == \-1) {
perror("close_range");
exit(EXIT_FAILURE);
}