From 2430d2a7b34a219fc6c4b06e3c2013f7357cab4c Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Wed, 11 Aug 2021 01:48:02 +0200 Subject: [PATCH] pidfd_open.2: Document PIDFD_NONBLOCK Signed-off-by: Michael Kerrisk --- man2/pidfd_open.2 | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/man2/pidfd_open.2 b/man2/pidfd_open.2 index cb91ce71f..fca5320ab 100644 --- a/man2/pidfd_open.2 +++ b/man2/pidfd_open.2 @@ -49,8 +49,17 @@ the close-on-exec flag is set on the file descriptor. .PP The .I flags -argument is reserved for future use; -currently, this argument must be specified as 0. +argument either has the value 0, or contains the following flag: +.TP +.BR PIDFD_NONBLOCK " (since Linux 5.10)" +.\" commit 4da9af0014b51c8b015ed8c622440ef28912efe6 +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) +will immediately return the error +.BR EAGAIN +rather than blocking. .SH RETURN VALUE On success, .BR pidfd_open () @@ -62,7 +71,7 @@ is set to indicate the error. .TP .B EINVAL .I flags -is not 0. +is not valid. .TP .B EINVAL .I pid