* If we have kernel support for IORING_ENTER_EXT_ARG, then we can use that * more efficiently than queueing an internal timeout command. */
| 286 | * more efficiently than queueing an internal timeout command. |
| 287 | */ |
| 288 | static int io_uring_wait_cqes_new(struct io_uring *ring, |
| 289 | struct io_uring_cqe **cqe_ptr, |
| 290 | unsigned wait_nr, |
| 291 | struct __kernel_timespec *ts, |
| 292 | unsigned int min_wait_usec, |
| 293 | sigset_t *sigmask) |
| 294 | { |
| 295 | struct io_uring_getevents_arg arg = { |
| 296 | .sigmask = (unsigned long) sigmask, |
| 297 | .sigmask_sz = _NSIG / 8, |
| 298 | .ts = (unsigned long) ts |
| 299 | }; |
| 300 | struct get_data data = { |
| 301 | .wait_nr = wait_nr, |
| 302 | .get_flags = IORING_ENTER_EXT_ARG, |
| 303 | .sz = sizeof(arg), |
| 304 | .has_ts = ts != NULL, |
| 305 | .arg = &arg |
| 306 | }; |
| 307 | |
| 308 | if (min_wait_usec && ring->features & IORING_FEAT_MIN_TIMEOUT) |
| 309 | arg.min_wait_usec = min_wait_usec; |
| 310 | |
| 311 | return _io_uring_get_cqe(ring, cqe_ptr, &data); |
| 312 | } |
| 313 | |
| 314 | /* |
| 315 | * Like io_uring_wait_cqe(), except it accepts a timeout value as well. Note |
no test coverage detected