eventpoll: add epoll_pwait3()
authorJens Axboe <axboe@kernel.dk>
Wed, 12 Apr 2023 16:04:49 +0000 (10:04 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 12 Apr 2023 16:30:58 +0000 (10:30 -0600)
commit343353f60bfa9ffcf17dee8189972f43575bbe5e
treeb36def8f199da6414554d58befde766cc829ff8c
parentc64c5f758d0840401f6ab939c6b21fa2cbec5ed3
eventpoll: add epoll_pwait3()

This adds epoll_pwait3(), which add a min_wait_ts argument. As we're
already at the max for how many arguments epoll_pwait2() uses, we wrap
a number of the arguments in struct epoll_pwait_data:

struct epoll_pwait_data {
struct __kernel_timespec timeout;
__u32 min_wait_ts;
__u32 sigmask_sz;
__u64 unused[2];
sigset_t sigmask;
};

and define a set of flags to tell the kernel which members are populated:

The application may then pass in any combination of these flags, if it
wishes to use timeouts, min_wait_ts, or a sigmask. The struct has two
64-bit values unused and the syscall checks for valid flags, so this can
be extended in the future.

epoll_pwait3() is defined as follows:

sys_epoll_pwait3(int epfd, struct epoll_event __user *events,
                 int maxevents, int flags,
                 struct epoll_pwait_data __user *data);

If 'flags' is 0, then 'data' may also be zero and hence need not be
passed in at all.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/eventpoll.c
include/uapi/linux/eventpoll.h