Lines Matching refs:fd
74 int fd, err; in port_open() local
76 fd = port_wait(data->kernel_data); in port_open()
77 if ((fd >= 0) && data->raw) { in port_open()
78 CATCH_EINTR(err = tcgetattr(fd, &data->tt)); in port_open()
82 err = raw(fd); in port_open()
87 return fd; in port_open()
90 static void port_close(int fd, void *d) in port_close() argument
95 os_close_file(fd); in port_close()
114 int fd, err, arg; in port_listen_fd() local
116 fd = socket(PF_INET, SOCK_STREAM, 0); in port_listen_fd()
117 if (fd == -1) in port_listen_fd()
121 if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &arg, sizeof(arg)) < 0) { in port_listen_fd()
129 if (bind(fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) { in port_listen_fd()
134 if (listen(fd, 1) < 0) { in port_listen_fd()
139 err = os_set_fd_block(fd, 0); in port_listen_fd()
143 return fd; in port_listen_fd()
145 close(fd); in port_listen_fd()
167 int port_connection(int fd, int *socket, int *pid_out) in port_connection() argument
174 new = accept(fd, NULL, 0); in port_connection()