Lines Matching refs:sock
53 blocking_socket(int sock)
57 flags = fcntl(sock, F_GETFL);
63 proto_descriptor_send(int sock, int fd)
69 PJDLOG_ASSERT(sock >= 0);
86 if (sendmsg(sock, &msg, 0) == -1)
93 proto_common_send(int sock, const unsigned char *data, size_t size, int fd)
99 PJDLOG_ASSERT(sock >= 0);
106 if (shutdown(sock, SHUT_RD) == -1)
116 done = send(sock, data, sendsize, MSG_NOSIGNAL);
145 if (errno == EAGAIN && blocking_socket(sock))
159 return (proto_descriptor_send(sock, fd));
163 proto_descriptor_recv(int sock, int *fdp)
169 PJDLOG_ASSERT(sock >= 0);
180 if (recvmsg(sock, &msg, 0) == -1)
194 proto_common_recv(int sock, unsigned char *data, size_t size, int *fdp)
198 PJDLOG_ASSERT(sock >= 0);
205 if (shutdown(sock, SHUT_WR) == -1)
214 done = recv(sock, data, size, MSG_WAITALL);
225 if (errno == EAGAIN && blocking_socket(sock))
231 return (proto_descriptor_recv(sock, fdp));