| 404 | } |
| 405 | |
| 406 | static int __io_uring_submit_and_wait_timeout(struct io_uring *ring, |
| 407 | struct io_uring_cqe **cqe_ptr, unsigned wait_nr, |
| 408 | struct __kernel_timespec *ts, |
| 409 | unsigned int min_wait, sigset_t *sigmask) |
| 410 | { |
| 411 | int to_submit; |
| 412 | |
| 413 | if (ts) { |
| 414 | if (ring->features & IORING_FEAT_EXT_ARG) { |
| 415 | struct io_uring_getevents_arg arg = { |
| 416 | .sigmask = (unsigned long) sigmask, |
| 417 | .sigmask_sz = _NSIG / 8, |
| 418 | .min_wait_usec = min_wait, |
| 419 | .ts = (unsigned long) ts |
| 420 | }; |
| 421 | struct get_data data = { |
| 422 | .submit = __io_uring_flush_sq(ring), |
| 423 | .wait_nr = wait_nr, |
| 424 | .get_flags = IORING_ENTER_EXT_ARG, |
| 425 | .sz = sizeof(arg), |
| 426 | .has_ts = ts != NULL, |
| 427 | .arg = &arg |
| 428 | }; |
| 429 | |
| 430 | return _io_uring_get_cqe(ring, cqe_ptr, &data); |
| 431 | } |
| 432 | to_submit = __io_uring_submit_timeout(ring, wait_nr, ts); |
| 433 | if (to_submit < 0) |
| 434 | return to_submit; |
| 435 | } else |
| 436 | to_submit = __io_uring_flush_sq(ring); |
| 437 | |
| 438 | return __io_uring_get_cqe(ring, cqe_ptr, to_submit, wait_nr, sigmask); |
| 439 | } |
| 440 | |
| 441 | int io_uring_submit_and_wait_min_timeout(struct io_uring *ring, |
| 442 | struct io_uring_cqe **cqe_ptr, |
no test coverage detected