… | |
… | |
297 | iocb->io.aio_reqprio = 0; |
297 | iocb->io.aio_reqprio = 0; |
298 | } |
298 | } |
299 | |
299 | |
300 | if (iocb->io.aio_buf) |
300 | if (iocb->io.aio_buf) |
301 | { |
301 | { |
|
|
302 | for (;;) |
|
|
303 | { |
|
|
304 | /* on all relevant kernels, io_cancel fails with EINPROGRESS on "success" */ |
302 | evsys_io_cancel (linuxaio_ctx, &iocb->io, (struct io_event *)0); |
305 | if (expect_false (evsys_io_cancel (linuxaio_ctx, &iocb->io, (struct io_event *)0) == 09) |
303 | /* on relevant kernels, io_cancel fails with EINPROGRES if everything is fine */ |
306 | break; |
|
|
307 | |
|
|
308 | if (expect_true (errno == EINPROGRESS)) |
|
|
309 | break; |
|
|
310 | |
|
|
311 | /* the EINPROGRESS test is for nicer error message. clumsy. */ |
304 | assert (("libev: linuxaio unexpected io_cancel failed", errno == EINPROGRESS || errno == EINTR)); |
312 | assert (("libev: linuxaio unexpected io_cancel failed", errno != EINPROGRESS && errno != EINTR)); |
|
|
313 | } |
305 | } |
314 | } |
306 | |
315 | |
307 | if (nev) |
316 | if (nev) |
308 | { |
317 | { |
309 | iocb->io.aio_buf = |
318 | iocb->io.aio_buf = |
… | |
… | |
553 | assert (("libev: event loop rejected bad fd", errno != EBADF)); |
562 | assert (("libev: event loop rejected bad fd", errno != EBADF)); |
554 | fd_kill (EV_A_ linuxaio_submits [submitted]->aio_fildes); |
563 | fd_kill (EV_A_ linuxaio_submits [submitted]->aio_fildes); |
555 | |
564 | |
556 | res = 1; /* skip this iocb */ |
565 | res = 1; /* skip this iocb */ |
557 | } |
566 | } |
558 | else if (errno == EINTR) |
567 | else if (errno == EINTR) /* not seen in reality, not documented */ |
559 | /* silently ignored */; |
568 | res = 0; /* silently ignore and retry */ |
560 | else |
569 | else |
561 | ev_syserr ("(libev) linuxaio io_submit"); |
570 | ev_syserr ("(libev) linuxaio io_submit"); |
562 | |
571 | |
563 | submitted += res; |
572 | submitted += res; |
564 | } |
573 | } |