Home
last modified time | relevance | path

Searched refs:fd (Results 1 – 25 of 72) sorted by path

123

/unit/auto/
H A Dfiles76 int fd = syscall(SYS_openat2, AT_FDCWD, \".\",
78 if (fd == -1)
H A Dsendfile152 sbsize_t sendfile(int s, int fd, off_t offset,
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)
/unit/go/
H A Dport.go73 func getUnixConn(fd int) *net.UnixConn {
74 if fd < 0 {
78 f := os.NewFile(uintptr(fd), "sock")
89 nxt_go_alert("Not a Unix-domain socket %d", fd)
/unit/src/
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_cert.c38 nxt_fd_t fd; member
42 static nxt_cert_t *nxt_cert_fd(nxt_task_t *task, nxt_fd_t fd);
78 nxt_cert_fd(nxt_task_t *task, nxt_fd_t fd) in nxt_cert_fd() argument
83 bio = BIO_new_fd(fd, 0); in nxt_cert_fd()
352 cert = nxt_cert_fd(task, items[i].fd); in nxt_cert_info_init()
869 item->fd = -1; in nxt_cert_store_load()
901 item->fd = file.fd; in nxt_cert_store_load()
942 nxt_fd_close(items[i].fd); in nxt_cert_store_release()
1153 file.fd = -1; in nxt_cert_store_get_handler()
1186 (void) nxt_port_socket_write(task, port, type, file.fd, in nxt_cert_store_get_handler()
H A Dnxt_clone.c41 int fd, n; in nxt_clone_credential_setgroups() local
54 fd = open((char *)path, O_RDWR); in nxt_clone_credential_setgroups()
56 if (fd == -1) { in nxt_clone_credential_setgroups()
71 n = write(fd, str, strlen(str)); in nxt_clone_credential_setgroups()
72 close(fd); in nxt_clone_credential_setgroups()
H A Dnxt_conn.c55 c->socket.fd = -1; in nxt_conn_create()
169 ret = getsockname(c->socket.fd, &sa->u.sockaddr, &socklen); in nxt_conn_local_addr()
171 nxt_alert(task, "getsockname(%d) failed", c->socket.fd); in nxt_conn_local_addr()
H A Dnxt_conn.h198 ret = nxt_socket_setsockopt(task, (c)->socket.fd, IPPROTO_TCP, \
212 ret = nxt_socket_setsockopt(task, (c)->socket.fd, IPPROTO_TCP, \
H A Dnxt_conn_accept.c46 lev->socket.fd = ls->socket; in nxt_listen_event()
161 s = accept(lev->socket.fd, sa, &socklen); in nxt_conn_io_accept()
168 c->socket.fd = s; in nxt_conn_io_accept()
181 nxt_debug(task, "accept(%d): %d", lev->socket.fd, s); in nxt_conn_io_accept()
292 c->socket.fd, c->socket.read_ready); in nxt_conn_accept_close_idle_handler()
324 nxt_debug(task, "%s(%d) %E", accept_syscall, lev->socket.fd, err); in nxt_conn_accept_error()
330 accept_syscall, lev->socket.fd, err); in nxt_conn_accept_error()
338 accept_syscall, lev->socket.fd, err); in nxt_conn_accept_error()
345 accept_syscall, lev->socket.fd, err); in nxt_conn_accept_error()
380 nxt_alert(task, "accept(%d) event error", ev->fd); in nxt_conn_listen_event_error()
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()
147 nxt_debug(task, "conn close timer handler fd:%d", c->socket.fd); in nxt_conn_close_timer_handler()
149 if (c->socket.fd != -1) { in nxt_conn_close_timer_handler()
150 nxt_socket_close(task, c->socket.fd); in nxt_conn_close_timer_handler()
[all …]
H A Dnxt_conn_connect.c46 switch (nxt_socket_connect(task, c->socket.fd, c->remote)) { in nxt_conn_io_connect()
104 c->socket.fd = s; in nxt_conn_socket()
129 nxt_debug(task, "event connect test fd:%d", c->socket.fd); in nxt_conn_connect_test()
192 err = nxt_socket_error(c->socket.fd); in nxt_conn_connect_test_error()
198 c->socket.fd, (size_t) c->remote->length, in nxt_conn_connect_test_error()
H A Dnxt_conn_proxy.c165 if (p->peer->socket.fd != -1) { in nxt_conn_proxy_client_buffer_alloc()
384 sink->socket.fd, sink->socket.error); in nxt_conn_proxy_read_process()
499 nxt_debug(task, "conn proxy read fd:%d", source->socket.fd); in nxt_conn_proxy_read()
740 nxt_debug(task, "conn proxy error fd:%d", c->socket.fd); in nxt_conn_proxy_error()
808 nxt_socket_close(task, peer->socket.fd); in nxt_conn_proxy_refused()
809 peer->socket.fd = -1; in nxt_conn_proxy_refused()
871 nxt_socket_shutdown(task, sink->socket.fd, SHUT_WR); in nxt_conn_proxy_shutdown()
948 p->client->socket.fd, p->peer->socket.fd); in nxt_conn_proxy_complete()
955 if (p->client->socket.fd != -1) { in nxt_conn_proxy_complete()
961 if (p->peer->socket.fd != -1) { in nxt_conn_proxy_complete()
[all …]
H A Dnxt_conn_read.c17 c->socket.fd, c->socket.read_ready); in nxt_conn_wait()
49 c->socket.fd, c->socket.read_ready, c->socket.closed, in nxt_conn_io_read()
153 n = readv(c->socket.fd, iov, niov); in nxt_conn_io_recvbuf()
157 nxt_debug(c->socket.task, "readv(%d, %ui): %z", c->socket.fd, niov, n); in nxt_conn_io_recvbuf()
189 "readv(%d, %ui) failed %E", c->socket.fd, niov, err); in nxt_conn_io_recvbuf()
204 n = recv(c->socket.fd, buf, size, flags); in nxt_conn_io_recv()
209 c->socket.fd, buf, size, flags, n); in nxt_conn_io_recv()
247 c->socket.fd, buf, size, flags, err); in nxt_conn_io_recv()
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 …]
H A Dnxt_controller.c562 nxt_fd_t fd; in nxt_controller_conf_send() local
584 fd = nxt_shm_open(task, size); in nxt_controller_conf_send()
585 if (nxt_slow_path(fd == -1)) { in nxt_controller_conf_send()
623 nxt_fd_close(fd); in nxt_controller_conf_send()
681 nxt_debug(task, "controller conn init fd:%d", c->socket.fd); in nxt_controller_conn_init()
1662 nxt_fd_close(msg->fd[0]); in nxt_controller_process_cert_save()
1908 nxt_fd_t fd; in nxt_controller_conf_store() local
1919 fd = nxt_shm_open(task, size); in nxt_controller_conf_store()
1920 if (nxt_slow_path(fd == -1)) { in nxt_controller_conf_store()
1944 fd, 0, -1, b); in nxt_controller_conf_store()
[all …]
H A Dnxt_cyassl.c316 nxt_log_debug(thr->log, "CyaSSL_negotiate(%d): %d", c->socket.fd, ret); in nxt_cyassl_conn_handshake()
327 c->socket.fd); in nxt_cyassl_conn_handshake()
367 c->socket.fd, b->mem.free, b->mem.end - b->mem.free, ret); in nxt_cyassl_conn_io_read()
383 c->socket.fd, b->mem.free, in nxt_cyassl_conn_io_read()
431 c->socket.fd, buf, size, ret); in nxt_cyassl_conn_io_send()
442 c->socket.fd, buf, size); in nxt_cyassl_conn_io_send()
464 nxt_log_debug(thr->log, "CyaSSL_shutdown(%d): %d", c->socket.fd, ret); in nxt_cyassl_conn_io_shutdown()
467 nxt_cyassl_conn_error(c, 0, "CyaSSL_shutdown(%d) failed", c->socket.fd); in nxt_cyassl_conn_io_shutdown()
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_event_conn_job_sendfile.c49 nxt_debug(task, "event conn sendfile fd:%d", c->socket.fd); in nxt_event_conn_job_sendfile_start()
107 nxt_debug(task, "event conn job sendfile fd:%d", c->socket.fd); in nxt_event_conn_job_sendfile_handler()
H A Dnxt_event_engine.c204 pipe->event.fd = pipe->fds[0]; in nxt_event_engine_signal_pipe_create()
304 n = nxt_fd_read(ev->fd, buf, sizeof(buf)); in nxt_event_engine_signal_pipe()
H A Dnxt_event_engine.h173 int fd; member
199 int fd; member
237 int fd; member
264 int fd; member
345 nxt_int_t nxt_fd_event_hash_add(nxt_lvlhsh_t *lvlhsh, nxt_fd_t fd,
348 nxt_fd_t fd);
350 nxt_fd_t fd, nxt_bool_t ignore);
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_external.c31 nxt_external_fd_no_cloexec(nxt_task_t *task, nxt_socket_t fd) in nxt_external_fd_no_cloexec() argument
35 if (fd == -1) { in nxt_external_fd_no_cloexec()
39 flags = fcntl(fd, F_GETFD); in nxt_external_fd_no_cloexec()
42 nxt_alert(task, "fcntl(%d, F_GETFD) failed %E", fd, nxt_errno); in nxt_external_fd_no_cloexec()
48 res = fcntl(fd, F_SETFD, flags); in nxt_external_fd_no_cloexec()
51 nxt_alert(task, "fcntl(%d, F_SETFD) failed %E", fd, nxt_errno); in nxt_external_fd_no_cloexec()
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 …]

123