From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: linux-fsdevel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk,
akpm@linux-foundation.org, soheil.kdev@gmail.com, arnd@arndb.de,
shuochen@google.com, linux-man@vger.kernel.org,
Willem de Bruijn <willemb@google.com>
Subject: [PATCH manpages RFC] epoll_wait.2: add epoll_pwait2
Date: Wed, 18 Nov 2020 09:46:16 -0500 [thread overview]
Message-ID: <20201118144617.986860-3-willemdebruijn.kernel@gmail.com> (raw)
In-Reply-To: <20201118144617.986860-1-willemdebruijn.kernel@gmail.com>
From: Willem de Bruijn <willemb@google.com>
Expand the epoll_wait page with epoll_pwait2, an epoll_wait variant
that takes a struct timespec to enable nanosecond resolution timeout.
int epoll_pwait2(int fd, struct epoll_event *events,
int maxevents,
const struct timespec *timeout,
const sigset_t *sigset);
Signed-off-by: Willem de Bruijn <willemb@google.com>
---
man2/epoll_wait.2 | 31 +++++++++++++++++++++++++++++--
1 file changed, 29 insertions(+), 2 deletions(-)
diff --git a/man2/epoll_wait.2 b/man2/epoll_wait.2
index 55890c82a53a..01047df28cb1 100644
--- a/man2/epoll_wait.2
+++ b/man2/epoll_wait.2
@@ -22,7 +22,7 @@
.\"
.TH EPOLL_WAIT 2 2020-04-11 "Linux" "Linux Programmer's Manual"
.SH NAME
-epoll_wait, epoll_pwait \- wait for an I/O event on an epoll file descriptor
+epoll_wait, epoll_pwait, epoll_pwait2 \- wait for an I/O event on an epoll file descriptor
.SH SYNOPSIS
.nf
.B #include <sys/epoll.h>
@@ -32,6 +32,9 @@ epoll_wait, epoll_pwait \- wait for an I/O event on an epoll file descriptor
.BI "int epoll_pwait(int " epfd ", struct epoll_event *" events ,
.BI " int " maxevents ", int " timeout ,
.BI " const sigset_t *" sigmask );
+.BI "int epoll_pwait2(int " epfd ", struct epoll_event *" events ,
+.BI " int " maxevents ", const struct timespec *" timeout ,
+.BI " const sigset_t *" sigmask );
.fi
.SH DESCRIPTION
The
@@ -170,6 +173,25 @@ argument may be specified as NULL, in which case
.BR epoll_pwait ()
is equivalent to
.BR epoll_wait ().
+.SS epoll_pwait2 ()
+The
+.BR epoll_pwait2 ()
+system call is equivalent to
+.BR epoll_pwait ()
+except for the
+.I timeout
+argument. It takes an argument of type
+.I timespec
+to be able to specify nanosecond resolution timeouts. This argument functions
+the same as in
+.BR pselect (2)
+and
+.BR ppoll (2).
+If
+.I timeout
+is NULL, then
+.BR epoll_pwait2 ()
+can block indefinitely.
.SH RETURN VALUE
When successful,
.BR epoll_wait ()
@@ -217,6 +239,9 @@ Library support is provided in glibc starting with version 2.3.2.
.BR epoll_pwait ()
was added to Linux in kernel 2.6.19.
Library support is provided in glibc starting with version 2.6.
+.PP
+.BR epoll_pwait2 ()
+was added to Linux in kernel 5.11.
.SH CONFORMING TO
.BR epoll_wait ()
is Linux-specific.
@@ -267,7 +292,9 @@ this means that timeouts greater than 35.79 minutes are treated as infinity.
.SS C library/kernel differences
The raw
.BR epoll_pwait ()
-system call has a sixth argument,
+and
+.BR epoll_pwait2 ()
+system calls have a sixth argument,
.IR "size_t sigsetsize" ,
which specifies the size in bytes of the
.IR sigmask
--
2.29.2.454.gaff20da3a2-goog
next prev parent reply other threads:[~2020-11-18 14:46 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-18 14:46 [PATCH v3 0/2] add epoll_pwait2 syscall Willem de Bruijn
2020-11-18 14:46 ` [PATCH v3 1/2] epoll: add nsec timeout support with epoll_pwait2 Willem de Bruijn
2020-11-18 15:00 ` Matthew Wilcox
2020-11-18 15:10 ` Willem de Bruijn
2020-11-18 15:37 ` Arnd Bergmann
2020-11-18 15:59 ` David Laight
2020-11-19 14:19 ` Willem de Bruijn
2020-11-19 14:31 ` Matthew Wilcox
2020-11-19 15:37 ` Willem de Bruijn
2020-11-19 15:45 ` Arnd Bergmann
2020-11-19 20:13 ` Willem de Bruijn
2020-11-20 8:13 ` Arnd Bergmann
2020-11-20 16:01 ` Willem de Bruijn
2020-11-20 19:23 ` Arnd Bergmann
2020-11-20 22:28 ` Willem de Bruijn
2020-11-21 9:27 ` Arnd Bergmann
2020-12-10 17:33 ` Willem de Bruijn
2020-12-10 20:34 ` Arnd Bergmann
2020-12-10 22:59 ` Willem de Bruijn
2021-01-11 20:06 ` Willem de Bruijn
2020-11-18 16:21 ` Willem de Bruijn
2020-11-18 16:50 ` Arnd Bergmann
2020-11-19 3:22 ` Willem de Bruijn
2020-11-18 14:46 ` Willem de Bruijn [this message]
2020-11-18 14:46 ` [PATCH v3 2/2] selftests/filesystems: expand epoll " Willem de Bruijn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201118144617.986860-3-willemdebruijn.kernel@gmail.com \
--to=willemdebruijn.kernel@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-man@vger.kernel.org \
--cc=shuochen@google.com \
--cc=soheil.kdev@gmail.com \
--cc=viro@zeniv.linux.org.uk \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).