Lines Matching refs:fd

58 static void nxt_devpoll_remove(nxt_event_engine_t *engine, nxt_fd_t fd);
101 engine->u.devpoll.fd = -1; in nxt_devpoll_create()
128 engine->u.devpoll.fd = open("/dev/poll", O_RDWR); in nxt_devpoll_create()
130 if (engine->u.devpoll.fd == -1) { in nxt_devpoll_create()
135 nxt_debug(&engine->task, "open(\"/dev/poll\"): %d", engine->u.devpoll.fd); in nxt_devpoll_create()
150 nxt_fd_t fd; in nxt_devpoll_free() local
152 fd = engine->u.devpoll.fd; in nxt_devpoll_free()
154 nxt_debug(&engine->task, "devpoll %d free", fd); in nxt_devpoll_free()
156 if (fd != -1 && close(fd) != 0) { in nxt_devpoll_free()
157 nxt_alert(&engine->task, "devpoll close(%d) failed %E", fd, nxt_errno); in nxt_devpoll_free()
378 engine->u.devpoll.fd, ev->fd, op, events); in nxt_devpoll_change()
403 engine->u.devpoll.fd, engine->u.devpoll.nchanges); in nxt_devpoll_commit_changes()
415 ev->fd, change->op, change->events); in nxt_devpoll_commit_changes()
419 pfd->fd = ev->fd; in nxt_devpoll_commit_changes()
425 pfd->fd = ev->fd; in nxt_devpoll_commit_changes()
456 ret = nxt_fd_event_hash_add(&engine->u.devpoll.fd_hash, ev->fd, ev); in nxt_devpoll_commit_changes()
465 ev->fd, 0); in nxt_devpoll_commit_changes()
489 nxt_fd_event_hash_delete(ev->task, &engine->u.devpoll.fd_hash, ev->fd, 1); in nxt_devpoll_change_error()
491 nxt_devpoll_remove(engine, ev->fd); in nxt_devpoll_change_error()
496 nxt_devpoll_remove(nxt_event_engine_t *engine, nxt_fd_t fd) in nxt_devpoll_remove() argument
501 pfd.fd = fd; in nxt_devpoll_remove()
505 n = ioctl(engine->u.devpoll.fd, DP_ISPOLLED, &pfd); in nxt_devpoll_remove()
508 engine->u.devpoll.fd, fd, n); in nxt_devpoll_remove()
517 engine->u.devpoll.fd, fd, nxt_errno); in nxt_devpoll_remove()
524 engine->u.devpoll.fd, fd); in nxt_devpoll_remove()
526 pfd.fd = fd; in nxt_devpoll_remove()
537 int fd; in nxt_devpoll_write() local
539 fd = engine->u.devpoll.fd; in nxt_devpoll_write()
541 nxt_debug(&engine->task, "devpoll write(%d) changes:%uz", fd, n); in nxt_devpoll_write()
545 if (nxt_slow_path(write(fd, pfd, n) == (ssize_t) n)) { in nxt_devpoll_write()
549 nxt_alert(&engine->task, "devpoll write(%d) failed %E", fd, nxt_errno); in nxt_devpoll_write()
559 nxt_fd_t fd; in nxt_devpoll_poll() local
575 engine->u.devpoll.fd, timeout); in nxt_devpoll_poll()
581 nevents = ioctl(engine->u.devpoll.fd, DP_POLL, &dvp); in nxt_devpoll_poll()
588 engine->u.devpoll.fd, nevents); in nxt_devpoll_poll()
594 engine->u.devpoll.fd, err); in nxt_devpoll_poll()
602 fd = pfd->fd; in nxt_devpoll_poll()
606 fd); in nxt_devpoll_poll()
612 engine->u.devpoll.fd, fd, pfd->events, events); in nxt_devpoll_poll()
614 nxt_devpoll_remove(engine, fd); in nxt_devpoll_poll()
619 fd, events, ev->read, ev->write); in nxt_devpoll_poll()
624 engine->u.devpoll.fd, fd, pfd->events, events); in nxt_devpoll_poll()