… | |
… | |
250 | linuxaio_iocbps [fd]->io.aio_buf = 0; |
250 | linuxaio_iocbps [fd]->io.aio_buf = 0; |
251 | anfds [fd].events = 0; |
251 | anfds [fd].events = 0; |
252 | fd_change (EV_A_ fd, 0); |
252 | fd_change (EV_A_ fd, 0); |
253 | |
253 | |
254 | /* feed events, we do not expect or handle POLLNVAL */ |
254 | /* feed events, we do not expect or handle POLLNVAL */ |
255 | if (expect_false (res & POLLNVAL)) |
|
|
256 | fd_kill (EV_A_ fd); |
|
|
257 | else |
|
|
258 | fd_event ( |
255 | fd_event ( |
259 | EV_A_ |
256 | EV_A_ |
260 | fd, |
257 | fd, |
261 | (res & (POLLOUT | POLLERR | POLLHUP) ? EV_WRITE : 0) |
258 | (res & (POLLOUT | POLLERR | POLLHUP) ? EV_WRITE : 0) |
262 | | (res & (POLLIN | POLLERR | POLLHUP) ? EV_READ : 0) |
259 | | (res & (POLLIN | POLLERR | POLLHUP) ? EV_READ : 0) |
263 | ); |
260 | ); |
264 | |
261 | |
265 | --nr; |
262 | --nr; |
266 | ++ev; |
263 | ++ev; |
267 | } |
264 | } |
268 | } |
265 | } |
… | |
… | |
399 | * See https://lore.kernel.org/patchwork/patch/1047453/ to see |
396 | * See https://lore.kernel.org/patchwork/patch/1047453/ to see |
400 | * discussion about such a case (ttys) where polling for POLLIN |
397 | * discussion about such a case (ttys) where polling for POLLIN |
401 | * fails but POLLIN|POLLOUT works. |
398 | * fails but POLLIN|POLLOUT works. |
402 | */ |
399 | */ |
403 | struct iocb *iocb = linuxaio_submits [submitted]; |
400 | struct iocb *iocb = linuxaio_submits [submitted]; |
|
|
401 | |
|
|
402 | linuxaio_rearm_epoll (EV_A_ linuxaio_submits [submitted], EPOLL_CTL_ADD); |
|
|
403 | iocb->aio_reqprio = -1; /* mark iocb as epoll */ |
|
|
404 | |
404 | res = 1; /* skip this iocb */ |
405 | res = 1; /* skip this iocb */ |
405 | |
|
|
406 | linuxaio_rearm_epoll (EV_A_ iocb, EPOLL_CTL_ADD); |
|
|
407 | iocb->aio_reqprio = -1; /* mark iocb as epoll */ |
|
|
408 | } |
406 | } |
409 | #endif |
407 | #endif |
|
|
408 | else if (errno == EBADF) |
|
|
409 | { |
|
|
410 | fd_kill (EV_A_ linuxaio_submits [submitted]->aio_fildes); |
|
|
411 | |
|
|
412 | res = 1; /* skip this iocb */ |
|
|
413 | } |
410 | else |
414 | else |
411 | ev_syserr ("(libev) linuxaio io_submit"); |
415 | ev_syserr ("(libev) linuxaio io_submit"); |
412 | |
416 | |
413 | submitted += res; |
417 | submitted += res; |
414 | } |
418 | } |
… | |
… | |
473 | { |
477 | { |
474 | #if EPOLL_FALLBACK |
478 | #if EPOLL_FALLBACK |
475 | close (backend_fd); |
479 | close (backend_fd); |
476 | #endif |
480 | #endif |
477 | linuxaio_free_iocbp (EV_A); |
481 | linuxaio_free_iocbp (EV_A); |
478 | ev_io_destroy (linuxaio_ctx); |
482 | evsys_io_destroy (linuxaio_ctx); |
479 | } |
483 | } |
480 | |
484 | |
481 | inline_size |
485 | inline_size |
482 | void |
486 | void |
483 | linuxaio_fork (EV_P) |
487 | linuxaio_fork (EV_P) |