Lines Matching refs:fd
26 struct asocket *asocket_init(int fd) {
32 flags = fcntl(fd, F_GETFL);
35 if (fcntl(fd, F_SETFL, flags | O_NONBLOCK))
52 s->fd = fd;
65 ret = connect(s->fd, addr, addrlen);
73 pfd[0].fd = s->fd;
76 pfd[1].fd = s->abort_fd[0];
102 if (getsockopt(s->fd, SOL_SOCKET, SO_ERROR, &ret, &retlen))
109 /* some error event on this fd */
125 pfd[0].fd = s->fd;
128 pfd[1].fd = s->abort_fd[0];
154 ret = accept(s->fd, addr, addrlen);
157 /* some error event on this fd */
170 pfd[0].fd = s->fd;
173 pfd[1].fd = s->abort_fd[0];
199 ret = read(s->fd, buf, count);
202 /* some error event on this fd */
216 pfd[0].fd = s->fd;
219 pfd[1].fd = s->abort_fd[0];
245 ret = write(s->fd, buf, count);
248 /* some error event on this fd */
261 /* Prevent further use of fd, without yet releasing the fd */
262 shutdown(s->fd, SHUT_RDWR);
273 /* Clients should *not* be using these fd's after calling
275 stale fd */
276 s->fd = -1;
290 close(s_copy.fd);