Lines Matching refs:sock
52 blocking_socket(int sock) in blocking_socket() argument
56 flags = fcntl(sock, F_GETFL); in blocking_socket()
62 proto_descriptor_send(int sock, int fd) in proto_descriptor_send() argument
68 PJDLOG_ASSERT(sock >= 0); in proto_descriptor_send()
85 if (sendmsg(sock, &msg, 0) == -1) in proto_descriptor_send()
92 proto_common_send(int sock, const unsigned char *data, size_t size, int fd) in proto_common_send() argument
98 PJDLOG_ASSERT(sock >= 0); in proto_common_send()
105 if (shutdown(sock, SHUT_RD) == -1) in proto_common_send()
115 done = send(sock, data, sendsize, MSG_NOSIGNAL); in proto_common_send()
144 if (errno == EAGAIN && blocking_socket(sock)) in proto_common_send()
158 return (proto_descriptor_send(sock, fd)); in proto_common_send()
162 proto_descriptor_recv(int sock, int *fdp) in proto_descriptor_recv() argument
168 PJDLOG_ASSERT(sock >= 0); in proto_descriptor_recv()
179 if (recvmsg(sock, &msg, 0) == -1) in proto_descriptor_recv()
193 proto_common_recv(int sock, unsigned char *data, size_t size, int *fdp) in proto_common_recv() argument
197 PJDLOG_ASSERT(sock >= 0); in proto_common_recv()
204 if (shutdown(sock, SHUT_WR) == -1) in proto_common_recv()
213 done = recv(sock, data, size, MSG_WAITALL); in proto_common_recv()
224 if (errno == EAGAIN && blocking_socket(sock)) in proto_common_recv()
230 return (proto_descriptor_recv(sock, fdp)); in proto_common_recv()