diff --git a/man/io_uring_prep_waitid.3 b/man/io_uring_prep_waitid.3 index 011f2c9fe..34e5abdd3 100644 --- a/man/io_uring_prep_waitid.3 +++ b/man/io_uring_prep_waitid.3 @@ -14,7 +14,8 @@ io_uring_prep_waitid \- prepare a waitid request .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 @@ to specify the child state changes to wait for. Upon successful 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 2d136885e..f5c2d4638 100644 --- a/src/include/liburing.h +++ b/src/include/liburing.h @@ -1166,9 +1166,10 @@ IOURINGINLINE void io_uring_prep_waitid(struct io_uring_sqe *sqe, 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 d2222e64b..6666170c5 100644 --- a/test/waitid.c +++ b/test/waitid.c @@ -38,7 +38,7 @@ static int test_noexit(struct io_uring *ring) } 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 @@ static int test_double(struct io_uring *ring) } 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 @@ static int test_ready(struct io_uring *ring) } 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 @@ static int test_cancel(struct io_uring *ring) } 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 @@ static int test_cancel_race(struct io_uring *ring, int async) } 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 @@ static int test(struct io_uring *ring) } 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);