io_uring: add IORING_OP_WAITID support
authorJens Axboe <axboe@kernel.dk>
Mon, 10 Jul 2023 22:14:37 +0000 (16:14 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 11 Sep 2023 15:41:24 +0000 (09:41 -0600)
commit434666c1ec921dead4bc3e630b531c418ca3ffbe
tree303643bde28902c4c24d17476e3f7c5617737ff3
parentc61ab01362972e9b40f217d44ab7933e3bb86634
io_uring: add IORING_OP_WAITID support

This adds support for an async version of waitid(2), in a fully async
version. If an event isn't immediately available, wait for a callback
to trigger a retry.

The format of the sqe is as follows:

sqe->len The 'which', the idtype being queried/waited for.
sqe->fd The 'pid' (or id) being waited for.
sqe->file_index The 'options' being set.
sqe->addr2 A pointer to siginfo_t, if any, being filled in.

buf_index, add3, and waitid_flags are reserved/unused for now.
waitid_flags will be used for options for this request type. One
interesting use case may be to add multi-shot support, so that the
request stays armed and posts a notification every time a monitored
process state change occurs.

Note that this does not support rusage, on Arnd's recommendation.

See the waitid(2) man page for details on the arguments.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/io_uring_types.h
include/uapi/linux/io_uring.h
io_uring/Makefile
io_uring/cancel.c
io_uring/io_uring.c
io_uring/opdef.c
io_uring/waitid.c [new file with mode: 0644]
io_uring/waitid.h [new file with mode: 0644]