Home
last modified time | relevance | path

Searched refs:fd (Results 1 – 25 of 73) sorted by relevance

123

/unit/src/
H A Dnxt_file.c32 if (file->fd != -1) { in nxt_file_open()
74 if (file->fd != -1) { in nxt_file_openat2()
94 if (close(file->fd) != 0) { in nxt_file_close()
473 n = read(fd, buf, size); in nxt_fd_read()
493 nxt_fd_close(nxt_fd_t fd) in nxt_fd_close() argument
511 nxt_thread_log_debug("dup2(%FD, %FD, \"%FN\")", fd, file->fd, file->name); in nxt_file_redirect()
513 if (dup2(fd, file->fd) == -1) { in nxt_file_redirect()
515 fd, file->fd, file->name, nxt_errno); in nxt_file_redirect()
519 if (close(fd) != 0) { in nxt_file_redirect()
551 int flags, fd; in nxt_stderr_start() local
[all …]
H A Dnxt_select_engine.c130 nxt_fd_t fd; in nxt_select_enable_read() local
132 fd = ev->fd; in nxt_select_enable_read()
136 if (fd < 0 || fd >= (nxt_fd_t) FD_SETSIZE) { in nxt_select_enable_read()
157 nxt_fd_t fd; in nxt_select_enable_write() local
159 fd = ev->fd; in nxt_select_enable_write()
163 if (fd < 0 || fd >= (nxt_fd_t) FD_SETSIZE) { in nxt_select_enable_write()
200 fd = ev->fd; in nxt_select_disable_read()
204 if (fd < 0 || fd >= (nxt_fd_t) FD_SETSIZE) { in nxt_select_disable_read()
224 fd = ev->fd; in nxt_select_disable_write()
228 if (fd < 0 || fd >= (nxt_fd_t) FD_SETSIZE) { in nxt_select_disable_write()
[all …]
H A Dnxt_socketpair.c93 nxt_socket_msg_oob_init(&oob, fd); in nxt_socketpair_send()
96 n = nxt_sendmsg(ev->fd, iob, niob, &oob); in nxt_socketpair_send()
100 nxt_debug(ev->task, "sendmsg(%d, %FD, %FD, %ui): %z", ev->fd, fd[0], in nxt_socketpair_send()
101 fd[1], niob, n); in nxt_socketpair_send()
112 nxt_debug(ev->task, "sendmsg(%d) not ready", ev->fd); in nxt_socketpair_send()
119 nxt_debug(ev->task, "sendmsg(%d) no buffers", ev->fd); in nxt_socketpair_send()
123 nxt_debug(ev->task, "sendmsg(%d) interrupted", ev->fd); in nxt_socketpair_send()
128 ev->fd, fd[0], fd[1], niob, err); in nxt_socketpair_send()
148 n = nxt_recvmsg(ev->fd, iob, niob, oob); in nxt_socketpair_recv()
171 nxt_debug(ev->task, "recvmsg(%d) not ready", ev->fd); in nxt_socketpair_recv()
[all …]
H A Dnxt_fd_event.c11 static void nxt_fd_event_hash_error(nxt_task_t *task, nxt_fd_t fd);
33 nxt_fd_event_hash_add(nxt_lvlhsh_t *lvlhsh, nxt_fd_t fd, nxt_fd_event_t *ev) in nxt_fd_event_hash_add() argument
38 lhq.key_hash = nxt_murmur_hash2(&fd, sizeof(nxt_fd_t)); in nxt_fd_event_hash_add()
49 nxt_alert(ev->task, "fd event %d is already in hash", ev->fd); in nxt_fd_event_hash_add()
56 nxt_fd_event_hash_get(nxt_task_t *task, nxt_lvlhsh_t *lvlhsh, nxt_fd_t fd) in nxt_fd_event_hash_get() argument
61 lhq.key_hash = nxt_murmur_hash2(&fd, sizeof(nxt_fd_t)); in nxt_fd_event_hash_get()
70 nxt_fd_event_hash_error(task, fd); in nxt_fd_event_hash_get()
83 lhq.key_hash = nxt_murmur_hash2(&fd, sizeof(nxt_fd_t)); in nxt_fd_event_hash_delete()
90 nxt_fd_event_hash_error(task, fd); in nxt_fd_event_hash_delete()
109 nxt_fd_event_hash_error(nxt_task_t *task, nxt_fd_t fd) in nxt_fd_event_hash_error() argument
[all …]
H A Dnxt_devpoll_engine.c152 fd = engine->u.devpoll.fd; in nxt_devpoll_free()
156 if (fd != -1 && close(fd) != 0) { in nxt_devpoll_free()
419 pfd->fd = ev->fd; in nxt_devpoll_commit_changes()
425 pfd->fd = ev->fd; in nxt_devpoll_commit_changes()
501 pfd.fd = fd; in nxt_devpoll_remove()
508 engine->u.devpoll.fd, fd, n); 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()
[all …]
H A Dnxt_epoll_engine.c317 int fd; in nxt_epoll_free() local
323 fd = engine->u.epoll.signalfd.fd; in nxt_epoll_free()
325 if (fd != -1 && close(fd) != 0) { in nxt_epoll_free()
333 fd = engine->u.epoll.eventfd.fd; in nxt_epoll_free()
335 if (fd != -1 && close(fd) != 0) { in nxt_epoll_free()
341 fd = engine->u.epoll.fd; in nxt_epoll_free()
343 if (fd != -1 && close(fd) != 0) { in nxt_epoll_free()
593 engine->u.epoll.fd, ev->fd, op, events); in nxt_epoll_change()
626 engine->u.epoll.fd, ev->fd, change->op, in nxt_epoll_commit_changes()
687 if (fd == -1) { in nxt_epoll_add_signal()
[all …]
H A Dnxt_conn_close.c31 c->socket.fd, c->socket.timedout); in nxt_conn_close()
50 c->socket.fd, nxt_socket_errno); in nxt_conn_close()
83 nxt_debug(task, "conn shutdown handler fd:%d", c->socket.fd); in nxt_conn_shutdown_handler()
87 nxt_socket_shutdown(task, c->socket.fd, SHUT_RDWR); in nxt_conn_shutdown_handler()
104 nxt_debug(task, "conn close handler fd:%d", c->socket.fd); in nxt_conn_close_handler()
119 nxt_socket_close(task, c->socket.fd); in nxt_conn_close_handler()
120 c->socket.fd = -1; in nxt_conn_close_handler()
152 nxt_debug(task, "conn close timer handler fd:%d", c->socket.fd); in nxt_conn_close_timer_handler()
156 if (c->socket.fd != -1) { in nxt_conn_close_timer_handler()
157 nxt_socket_close(task, c->socket.fd); in nxt_conn_close_timer_handler()
[all …]
H A Dnxt_poll_engine.c22 nxt_socket_t fd; member
58 nxt_fd_t fd, int events);
62 nxt_fd_t fd);
413 phe->fd = ev->fd; in nxt_poll_set_add()
418 pfd->fd = ev->fd; in nxt_poll_set_add()
446 fd, events); in nxt_poll_set_change()
544 fd = pfd->fd; in nxt_poll()
554 pfd->fd = -1; in nxt_poll()
568 pfd->fd = -1; in nxt_poll()
669 if (nxt_fast_path(phe->fd == engine->u.poll.set[phe->index].fd)) { in nxt_poll_fd_hash_test()
[all …]
H A Dnxt_solaris_sendfilev.c45 nxt_debug(c->socket.task, "sendfilev(%d, %D)", c->socket.fd, nsfv); in nxt_solaris_event_conn_io_sendfilev()
52 n = sendfilev(c->socket.fd, sfv, nsfv, &sent); in nxt_solaris_event_conn_io_sendfilev()
71 "sendfilev(%d, %D) failed %E", c->socket.fd, nsfv, err); in nxt_solaris_event_conn_io_sendfilev()
94 nxt_fd_t fd, last_fd; in nxt_solaris_buf_coalesce() local
107 fd = b->file->fd; in nxt_solaris_buf_coalesce()
121 fd = SFV_FD_SELF; in nxt_solaris_buf_coalesce()
142 if (fd != last_fd || pos != last_pos) { in nxt_solaris_buf_coalesce()
148 sfv[i].sfv_fd = fd; in nxt_solaris_buf_coalesce()
159 last_fd = fd; in nxt_solaris_buf_coalesce()
H A Dnxt_port_socket.c178 msg.fd[0] = fd; in nxt_port_socket_write2()
179 msg.fd[1] = fd2; in nxt_port_socket_write2()
605 if (fd[0] != -1) { in nxt_port_close_fds()
607 fd[0] = -1; in nxt_port_close_fds()
612 fd[1] = -1; in nxt_port_close_fds()
867 msg.fd[0] = smsg->fd[0]; in nxt_port_queue_read_handler()
868 msg.fd[1] = smsg->fd[1]; in nxt_port_queue_read_handler()
981 smsg->fd[0] = msg.fd[0]; in nxt_port_queue_read_handler()
982 smsg->fd[1] = msg.fd[1]; in nxt_port_queue_read_handler()
1221 msg->fd[0] = fmsg->fd[0]; in nxt_port_read_msg_process()
[all …]
H A Dnxt_linux_sendfile.c99 c->socket.fd, fb->file->fd, fb->file_pos, size); in nxt_linux_event_conn_io_sendfile()
103 n = nxt_sys_sendfile(c->socket.fd, fb->file->fd, &offset, size); in nxt_linux_event_conn_io_sendfile()
123 c->socket.fd, fb->file->fd, fb->file_pos, size, in nxt_linux_event_conn_io_sendfile()
148 n = send(c->socket.fd, buf, size, flags); in nxt_linux_send()
153 c->socket.fd, buf, size, flags, n); in nxt_linux_send()
169 c->socket.fd, buf, size, flags, err); in nxt_linux_send()
203 n = sendmsg(c->socket.fd, &msg, flags); in nxt_linux_sendmsg()
208 c->socket.fd, niov, flags, n); in nxt_linux_sendmsg()
224 c->socket.fd, niov, flags, err); in nxt_linux_sendmsg()
H A Dnxt_kqueue_engine.c178 engine->u.kqueue.fd = -1; in nxt_kqueue_create()
193 engine->u.kqueue.fd = kqueue(); in nxt_kqueue_create()
194 if (engine->u.kqueue.fd == -1) { in nxt_kqueue_create()
222 nxt_fd_t fd; in nxt_kqueue_free() local
224 fd = engine->u.kqueue.fd; in nxt_kqueue_free()
231 if (close(fd) != 0) { in nxt_kqueue_free()
423 engine->u.kqueue.fd, ev->file->fd, EVFILT_VNODE, flags, fflags); in nxt_kqueue_enable_file()
427 kev->ident = ev->file->fd; in nxt_kqueue_enable_file()
450 engine->u.kqueue.fd, ev->fd, filter, flags); in nxt_kqueue_fd_set()
454 kev->ident = ev->fd; in nxt_kqueue_fd_set()
[all …]
H A Dnxt_mem_map.c12 nxt_fd_t fd, nxt_off_t offset) in nxt_mem_mmap() argument
16 p = mmap(addr, len, protection, flags, fd, offset); in nxt_mem_mmap()
20 addr, len, protection, flags, fd, offset, p); in nxt_mem_mmap()
24 addr, len, protection, flags, fd, offset, nxt_errno); in nxt_mem_mmap()
H A Dnxt_pollset_engine.c408 ctl->fd = ev->fd; in nxt_pollset_commit_changes()
414 ctl->fd = ev->fd; in nxt_pollset_commit_changes()
475 ev->fd, 1); in nxt_pollset_change_error()
477 nxt_pollset_remove(engine, ev->fd); in nxt_pollset_change_error()
488 pfd.fd = fd; in nxt_pollset_remove()
495 engine->u.pollset.ps, fd, n); in nxt_pollset_remove()
511 engine->u.pollset.ps, fd); in nxt_pollset_remove()
515 ctl.fd = fd; in nxt_pollset_remove()
548 nxt_fd_t fd; in nxt_pollset_poll() local
587 fd = pfd->fd; in nxt_pollset_poll()
[all …]
H A Dnxt_hpux_sendfile.c15 static ssize_t nxt_sys_sendfile(int s, int fd, off_t offset, size_t nbytes, in nxt_sys_sendfile() argument
25 sbsize_t sendfile(int s, int fd, off_t offset, bsize_t nbytes,
97 c->socket.fd, fb->file->fd, fb->file_pos, file_size, in nxt_hpux_event_conn_io_sendfile()
100 n = nxt_sys_sendfile(c->socket.fd, fb->file->fd, fb->file_pos, in nxt_hpux_event_conn_io_sendfile()
121 c->socket.fd, fb->file_pos, file_size, &fb->file->name, in nxt_hpux_event_conn_io_sendfile()
H A Dnxt_aix_send_file.c65 sfp.file_descriptor = fb->file->fd; in nxt_aix_event_conn_io_send_file()
75 c->socket.fd, fb->file->fd, fb->file_pos, file_size, nhd, ntr); in nxt_aix_event_conn_io_send_file()
77 n = send_file(&c->socket.fd, &sfp, 0); in nxt_aix_event_conn_io_send_file()
83 c->socket.fd, n, sent); in nxt_aix_event_conn_io_send_file()
106 c->socket.fd, err, fb->file->name, fb->file->fd, fb->file_pos, in nxt_aix_event_conn_io_send_file()
H A Dnxt_eventport_engine.c94 engine->u.eventport.fd = -1; in nxt_eventport_create()
110 engine->u.eventport.fd = port_create(); in nxt_eventport_create()
111 if (engine->u.eventport.fd == -1) { in nxt_eventport_create()
137 port = engine->u.eventport.fd; in nxt_eventport_free()
234 engine->u.eventport.fd, ev->fd, events, ev); in nxt_eventport_enable_event()
282 engine->u.eventport.fd, ev->fd); in nxt_eventport_disable_event()
304 port = engine->u.eventport.fd; in nxt_eventport_commit_changes()
440 port = engine->u.eventport.fd; in nxt_eventport_signal()
479 engine->u.eventport.fd, timeout); in nxt_eventport_poll()
528 engine->u.eventport.fd, nevents); in nxt_eventport_poll()
[all …]
H A Dnxt_macosx_sendfile.c17 static int nxt_sys_sendfile(int fd, int s, off_t offset, off_t *len, in nxt_sys_sendfile() argument
106 fb->file->fd, c->socket.fd, fb->file_pos, sent, in nxt_macosx_event_conn_io_sendfile()
109 n = nxt_sys_sendfile(fb->file->fd, c->socket.fd, in nxt_macosx_event_conn_io_sendfile()
130 fb->file->fd, c->socket.fd, fb->file_pos, sent, err, in nxt_macosx_event_conn_io_sendfile()
H A Dnxt_freebsd_sendfile.c21 static int nxt_sys_sendfile(int fd, int s, off_t offset, size_t nbytes, in nxt_sys_sendfile() argument
96 fb->file->fd, c->socket.fd, fb->file_pos, file_size, in nxt_freebsd_event_conn_io_sendfile()
100 n = nxt_sys_sendfile(fb->file->fd, c->socket.fd, fb->file_pos, in nxt_freebsd_event_conn_io_sendfile()
121 fb->file->fd, c->socket.fd, fb->file_pos, file_size, err, in nxt_freebsd_event_conn_io_sendfile()
H A Dnxt_file.h79 nxt_fd_t fd; member
183 NXT_EXPORT nxt_int_t nxt_fd_nonblocking(nxt_task_t *task, nxt_fd_t fd);
184 NXT_EXPORT nxt_int_t nxt_fd_blocking(nxt_task_t *task, nxt_fd_t fd);
185 NXT_EXPORT ssize_t nxt_fd_write(nxt_fd_t fd, u_char *buf, size_t size);
186 NXT_EXPORT ssize_t nxt_fd_read(nxt_fd_t fd, u_char *buf, size_t size);
187 NXT_EXPORT void nxt_fd_close(nxt_fd_t fd);
189 NXT_EXPORT nxt_int_t nxt_file_redirect(nxt_file_t *file, nxt_fd_t fd);
198 #define nxt_write_console(fd, buf, size) \ argument
199 write(fd, buf, size)
H A Dnxt_port_memory.c37 if (mmap_handler->fd != -1) { in nxt_port_mmap_handler_use()
205 nxt_fd_t fd) in nxt_port_incoming_port_mmap() argument
214 fd, process->pid); in nxt_port_incoming_port_mmap()
257 mmap_handler->fd = -1; in nxt_port_incoming_port_mmap()
291 nxt_fd_t fd; in nxt_port_new_port_mmap() local
314 if (nxt_slow_path(fd == -1)) { in nxt_port_new_port_mmap()
322 nxt_fd_close(fd); in nxt_port_new_port_mmap()
327 mmap_handler->fd = fd; in nxt_port_new_port_mmap()
370 nxt_fd_t fd; in nxt_shm_open() local
435 nxt_fd_close(fd); in nxt_shm_open()
[all …]
H A Dnxt_socket.h115 NXT_EXPORT ssize_t nxt_socketpair_send(nxt_fd_event_t *ev, nxt_fd_t *fd,
121 #define nxt_socket_nonblocking(task, fd) \ argument
122 nxt_fd_nonblocking(task, fd)
124 #define nxt_socket_blocking(task, fd) \ argument
125 nxt_fd_blocking(task, fd)
H A Dnxt_port.c181 msg->fd[0], msg->fd[1]); in nxt_port_handler()
282 nxt_fd_close(msg->fd[0]); in nxt_port_new_port_handler()
283 msg->fd[0] = -1; in nxt_port_new_port_handler()
294 nxt_fd_nonblocking(task, msg->fd[0]); in nxt_port_new_port_handler()
297 port->pair[1] = msg->fd[0]; in nxt_port_new_port_handler()
333 if (msg->fd[0] != -1) { in nxt_port_process_ready_handler()
334 port->queue_fd = msg->fd[0]; in nxt_port_process_ready_handler()
352 if (nxt_slow_path(msg->fd[0] == -1)) { in nxt_port_mmap_handler()
370 nxt_fd_close(msg->fd[0]); in nxt_port_mmap_handler()
376 nxt_fd_t fd) in nxt_port_change_log_file() argument
[all …]
H A Dnxt_conn_write.c13 static ssize_t nxt_sendfile(int fd, int s, off_t pos, size_t size);
28 c->socket.fd, c->socket.error, c->block_write); in nxt_conn_io_write()
45 sb.socket = c->socket.fd; in nxt_conn_io_write()
245 nxt_sendfile(int fd, int s, off_t pos, size_t size) in nxt_sendfile() argument
253 int rc = sendfile(fd, s, pos, &sent, NULL, 0); in nxt_sendfile()
261 int rc = sendfile(fd, s, pos, size, NULL, &sent, 0); in nxt_sendfile()
267 res = sendfile(s, fd, &pos, size); in nxt_sendfile()
465 n = writev(c->socket.fd, iob, niob); in nxt_event_conn_io_writev()
505 n = send(c->socket.fd, buf, size, 0); in nxt_event_conn_io_send()
510 c->socket.fd, buf, size, n); in nxt_event_conn_io_send()
[all …]
/unit/auto/
H A Dshmem27 int fd = shm_open(name, O_CREAT | O_EXCL | O_RDWR,
29 if (fd == -1)
70 int fd = shm_open(name, O_CREAT | O_EXCL | O_RDWR,
72 if (fd == -1)
98 int fd = shm_open(SHM_ANON, O_RDWR, S_IRUSR | S_IWUSR);
99 if (fd == -1)
125 int fd = syscall(SYS_memfd_create, name, MFD_CLOEXEC);
126 if (fd == -1)

123