waitid: add io_uring flags parameter Let's future proof this a bit and have the flags exposed, so that this prep helper will remain constant if we do decide to add some flags at a later time. Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/man/io_uring_prep_waitid.3 b/man/io_uring_prep_waitid.3 index 011f2c9..34e5abd 100644 --- a/man/io_uring_prep_waitid.3 +++ b/man/io_uring_prep_waitid.3
@@ -14,7 +14,8 @@ .BI " idtype_t " idtype "," .BI " id_t " id "," .BI " siginfo_t *" infop "," -.BI " int " options ");" +.BI " int " options "," +.BI " unsigned int " flags ");" .fi .SH DESCRIPTION .PP @@ -32,6 +33,10 @@ return, it fills .I infop with information of the child process, if any. +.I flags +is io_uring specific modifier flags. They are currently unused, and hence +.B 0 +should be passed. This function prepares an async .BR waitid (2)
diff --git a/src/include/liburing.h b/src/include/liburing.h index 2d13688..f5c2d46 100644 --- a/src/include/liburing.h +++ b/src/include/liburing.h
@@ -1166,9 +1166,10 @@ idtype_t idtype, id_t id, siginfo_t *infop, - int options) + int options, unsigned int flags) { io_uring_prep_rw(IORING_OP_WAITID, sqe, id, NULL, (unsigned) idtype, 0); + sqe->waitid_flags = flags; sqe->file_index = options; sqe->addr2 = (unsigned long) infop; }
diff --git a/test/waitid.c b/test/waitid.c index d2222e6..6666170 100644 --- a/test/waitid.c +++ b/test/waitid.c
@@ -38,7 +38,7 @@ } sqe = io_uring_get_sqe(ring); - io_uring_prep_waitid(sqe, P_PID, pid, &si, WEXITED); + io_uring_prep_waitid(sqe, P_PID, pid, &si, WEXITED, 0); sqe->flags |= IOSQE_IO_LINK; sqe->user_data = 1; @@ -96,7 +96,7 @@ } sqe = io_uring_get_sqe(ring); - io_uring_prep_waitid(sqe, P_PID, p2, &si, WEXITED); + io_uring_prep_waitid(sqe, P_PID, p2, &si, WEXITED, 0); io_uring_submit(ring); @@ -137,7 +137,7 @@ } sqe = io_uring_get_sqe(ring); - io_uring_prep_waitid(sqe, P_PID, pid, &si, WEXITED); + io_uring_prep_waitid(sqe, P_PID, pid, &si, WEXITED, 0); io_uring_submit(ring); @@ -177,7 +177,7 @@ } sqe = io_uring_get_sqe(ring); - io_uring_prep_waitid(sqe, P_PID, pid, NULL, WEXITED); + io_uring_prep_waitid(sqe, P_PID, pid, NULL, WEXITED, 0); sqe->user_data = 1; io_uring_submit(ring); @@ -228,7 +228,7 @@ } sqe = io_uring_get_sqe(ring); - io_uring_prep_waitid(sqe, P_ALL, -1, NULL, WEXITED); + io_uring_prep_waitid(sqe, P_ALL, -1, NULL, WEXITED, 0); if (async) sqe->flags |= IOSQE_ASYNC; sqe->user_data = 1; @@ -284,7 +284,7 @@ } sqe = io_uring_get_sqe(ring); - io_uring_prep_waitid(sqe, P_PID, pid, &si, WEXITED); + io_uring_prep_waitid(sqe, P_PID, pid, &si, WEXITED, 0); io_uring_submit(ring);