diff options
Diffstat (limited to 'man2/pidfd_open.2')
-rw-r--r-- | man2/pidfd_open.2 | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/man2/pidfd_open.2 b/man2/pidfd_open.2 index 02c741f2b..3eb22f3d6 100644 --- a/man2/pidfd_open.2 +++ b/man2/pidfd_open.2 @@ -20,7 +20,7 @@ Standard C library glibc provides no wrapper for .BR pidfd_open (), necessitating the use of -.BR syscall (2). +.MR syscall 2 . .SH DESCRIPTION The .BR pidfd_open () @@ -39,7 +39,7 @@ argument either has the value 0, or contains the following flag: Return a nonblocking file descriptor. If the process referred to by the file descriptor has not yet terminated, then an attempt to wait on the file descriptor using -.BR waitid (2) +.MR waitid 2 will immediately return the error .B EAGAIN rather than blocking. @@ -65,7 +65,7 @@ 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)). +.MR getrlimit 2 ). .TP .B ENFILE The system-wide limit on the total number of open files has been reached. @@ -87,7 +87,7 @@ Linux 5.3. .SH NOTES The following code sequence can be used to obtain a file descriptor for the child of -.BR fork (2): +.MR fork 2 : .P .in +4n .EX @@ -111,7 +111,7 @@ the disposition of has not been explicitly set to .B SIG_IGN (see -.BR sigaction (2)); +.MR sigaction 2 ); .IP \[bu] the .B SA_NOCLDWAIT @@ -120,18 +120,18 @@ flag was not specified while establishing a handler for or while setting the disposition of that signal to .B SIG_DFL (see -.BR sigaction (2)); +.MR sigaction 2 ); and .IP \[bu] the zombie process was not reaped elsewhere in the program (e.g., either by an asynchronously executed signal handler or by -.BR wait (2) +.MR wait 2 or similar in another thread). .P If any of these conditions does not hold, then the child process (along with a PID file descriptor that refers to it) should instead be created using -.BR clone (2) +.MR clone 2 with the .B CLONE_PIDFD flag. @@ -140,21 +140,21 @@ flag. A PID file descriptor returned by .BR pidfd_open () (or by -.BR clone (2) +.MR clone 2 with the .B CLONE_PID flag) can be used for the following purposes: .IP \[bu] 3 The -.BR pidfd_send_signal (2) +.MR pidfd_send_signal 2 system call can be used to send a signal to the process referred to by a PID file descriptor. .IP \[bu] A PID file descriptor can be monitored using -.BR poll (2), -.BR select (2), +.MR poll 2 , +.MR select 2 , and -.BR epoll (7). +.MR epoll 7 . When the process that it refers to terminates, these interfaces indicate the file descriptor as readable. Note, however, that in the current implementation, @@ -165,20 +165,20 @@ on the file descriptor fails with the error .IP \[bu] If the PID file descriptor refers to a child of the calling process, then it can be waited on using -.BR waitid (2). +.MR waitid 2 . .IP \[bu] The -.BR pidfd_getfd (2) +.MR pidfd_getfd 2 system call can be used to obtain a duplicate of a file descriptor of another process referred to by a PID file descriptor. .IP \[bu] A PID file descriptor can be used as the argument of -.BR setns (2) +.MR setns 2 in order to move into one or more of the same namespaces as the process referred to by the file descriptor. .IP \[bu] A PID file descriptor can be used as the argument of -.BR process_madvise (2) +.MR process_madvise 2 in order to provide advice on the memory usage patterns of the process referred to by the file descriptor. .P @@ -190,17 +190,17 @@ The alternative is to obtain a file descriptor by opening a .IR /proc/ pid directory. However, the latter technique is possible only if the -.BR proc (5) +.MR proc 5 filesystem is mounted; furthermore, the file descriptor obtained in this way is .I not pollable and can't be waited on with -.BR waitid (2). +.MR waitid 2 . .SH EXAMPLES The program below opens a PID file descriptor for the process whose PID is specified as its command-line argument. It then uses -.BR poll (2) +.MR poll 2 to monitor the file descriptor for process exit, as indicated by an .B EPOLLIN event. @@ -257,13 +257,13 @@ main(int argc, char *argv[]) .EE .\" SRC END .SH SEE ALSO -.BR clone (2), -.BR kill (2), -.BR pidfd_getfd (2), -.BR pidfd_send_signal (2), -.BR poll (2), -.BR process_madvise (2), -.BR select (2), -.BR setns (2), -.BR waitid (2), -.BR epoll (7) +.MR clone 2 , +.MR kill 2 , +.MR pidfd_getfd 2 , +.MR pidfd_send_signal 2 , +.MR poll 2 , +.MR process_madvise 2 , +.MR select 2 , +.MR setns 2 , +.MR waitid 2 , +.MR epoll 7 |