Lines Matching defs:s
156 getsockname(int s, struct sockaddr *name, socklen_t *namelen)
161 if ((i = so_check_fd(s, &errno)) == -1)
184 getsockopt(int s, int level, int option, void *optval, socklen_t *optlen)
189 if ((i = so_check_fd(s, &errno)) == -1)
305 setsockopt(int s, int level, int option, const void *optval, socklen_t optlen)
310 if ((i = so_check_fd(s, &errno)) == -1)
407 shutdown(int s, int how)
413 if ((sock_id = so_check_fd(s, &errno)) == -1)
473 socket_close(int s)
478 if ((sock_id = so_check_fd(s, &errno)) == -1)
511 * Read up to `nbyte' of data from socket `s' into `buf'; if non-zero,
516 socket_read(int s, void *buf, size_t nbyte, int read_timeout)
527 n = recvfrom(s, buf, nbyte, MSG_DONTWAIT, NULL, NULL);
542 * `addr' using socket `s'. Returns the number of bytes writte on success,
546 socket_write(int s, const void *buf, size_t nbyte, struct sockaddr_in *addr)
548 return (sendto(s, buf, nbyte, 0, (struct sockaddr *)addr,
579 bind(int s, const struct sockaddr *name, socklen_t namelen)
585 if ((i = so_check_fd(s, &errno)) == -1)
661 printf("quick bind done addr %s port %d\n",
782 recv(int s, void *buf, size_t len, int flags)
784 return (recvfrom(s, buf, len, flags, NULL, NULL));
794 recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from,
806 if ((sock_id = so_check_fd(s, &errno)) == -1) {
888 /* Need to copy from the socket's remote address. */
981 send(int s, const void *msg, size_t len, int flags)
983 return (sendto(s, msg, len, flags, NULL, 0));
992 sendto(int s, const void *msg, size_t len, int flags, const struct sockaddr *to,
1001 if ((sock_id = so_check_fd(s, &errno)) == -1) {
1064 printf("sendto(%d): msg of length: %d sent to port %d and host: %s\n",
1135 * Call directly TCP's send routine. We do this because TCP