Don't set it if we don't need to find an event (to_wait == 0).
Signed-off-by: Jens Axboe <axboe@kernel.dk>
* poll, or if IORING_SQ_NEED_WAKEUP is set.
*/
if (!sq_thread_poll || (*ring->flags & IORING_SQ_NEED_WAKEUP)) {
* poll, or if IORING_SQ_NEED_WAKEUP is set.
*/
if (!sq_thread_poll || (*ring->flags & IORING_SQ_NEED_WAKEUP)) {
- ret = io_uring_enter(s, to_submit, to_wait,
- IORING_ENTER_GETEVENTS);
+ unsigned flags = 0;
+
+ if (to_wait)
+ flags = IORING_ENTER_GETEVENTS;
+ ret = io_uring_enter(s, to_submit, to_wait, flags);