TCP/IP $B%^%M!<%8%c$O(B LAN $B$rMxMQ$7$?(B TCP/IP
$BDL?.$N5!G=$r
$BDL?.$O%=%1%C%H$r:n@.$7!"(B $B%=%1%C%H%G%9%/%j%W%?$r;HMQ$7$F9T$J$&!#(B $B$3$N%=%1%C%H%G%9%/%j%W%?$O%U%!%$%k%G%9%/%j%W%?$H$OJL$N35G0$G$"$j!"(B TCP/IP $B%^%M!<%8%c$N%7%9%F%`%3!<%k$G$O%=%1%C%H%G%9%/%j%W%?$N$_$r07$&$3$H$,$G$-$k!#(B
$B$^$?!"%=%1%C%H$K$h$kDL?.$G$"$C$F$b!"(B
$BF10l%^%7%sFb$N0[$J$k%W%m%;%94V$NDL?.
$B0J2<$N%G!<%?$rDj5A$9$k!#(B
$B0J2<$N%(%i!<%3!<%I$,Dj5A$5$l$F$$$k!#(B
TCP/IP $BDL?.$r=i4|2=$9$k!#(B
$BDL>o$O%"%W%j%1!<%7%g%s%W%m%;%9$,(B
TCP/IP $B$N=*N;@k8@!#(B
$B@\B3MW5a85$N%"%I%l%9$H$=$ND9$5$,!"(B
$B85$N%=%1%C%H(B
$BL>A0$J$7$N%=%1%C%H$K(B
$B%=%1%C%H$r%/%m!<%:$9$k!#(B
$B%=%1%C%H%G%9%/%j%W%?$N>uBV%U%i%0$r
$B%"%I%l%9$G;XDj$5$l$?%[%9%H$K4X$9$k>pJs$r(B
$B%=%1%C%H$K@\B3$5$l$F$$$kAj
$B;XDj$7$?%=%1%C%H$KBP$9$k8=:_$NL>A0(B($B%"%I%l%9(B)$B$rLa$9!#(B3.10.2 TCP/IP
/* $B%W%m%H%3%k%U%!%_%j(B */
#define PF_UNSPEC 0 /* unspecified protocol family */
#define PF_INET 2 /* TCP/IP and related */
/* $B%"%I%l%9%U%!%_%j(B
*/
#define AF_UNSPEC 0 /* unspecified address family */
#define AF_INET 2 /* TCP/IP and related */
/* $B%=%1%C%H%?%$%W(B
*/
#define SOCK_STREAM 1 /* stream socket */
#define SOCK_DGRAM 2 /* datagram socket */
#define SOCK_RAW 3 /* raw-protocol interface */
/* getsockopt(), setsockopt() $B$N%*%W%7%g%s(B
*/
#define SOL_SOCKET 0xffff /* options for socket level */
#define IPPROTO_TCP 0x0001 /* options for TCP level */
#define IPPROTO_IP 0x0002 /* options for IP level */
#define SO_DEBUG 0x0001 /* turn on debugging info recording */
#define SO_REUSEADDR 0x0004 /* allow local address reuse */
#define SO_KEEPALIVE 0x0008 /* keep connections alive */
#define SO_DONTROUTE 0x0010 /* just use interface addresses */
#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */
#define SO_LINGER 0x0080 /* linger on close if data present */
#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */
#define SO_SNDBUF 0x1001 /* send buffer size */
#define SO_RCVBUF 0x1002 /* receive buffer size */
#define SO_ERROR 0x1007 /* get error status and clear */
#define SO_TYPE 0x1008 /* get socket type */
#define TCP_MAXSEG 0x2000 /* maximum segment size */
#define TCP_NODELAY 0x2001 /* immediate send() */
#define IP_OPTIONS 0x0001 /* IP header options */
/* recv, send $B$N%*%W%7%g%s(B */
#define MSG_OOB 0x01 /* send or receive out of band data */
#define MSG_PEEK 0x02 /* take data but leave it */
#define MSG_DONTROUTE 0x04 /* do not route */
/* fcntl $B$N%*%W%7%g%s(B */
#define O_NDELAY 0x04 /* non-blocking */
#define FNDELAY O_NDELAY /* synonym */
#define F_GETFL 3 /* get flags */
#define F_SETFL 4 /* set flags */
/* ioctl $B$N%*%W%7%g%s(B */
#define SIOCATMARK 7 /* check for out of bound data */
/* $B%"%I%l%9(B */
struct sockaddr {
unsigned short sa_family; /* address family */
char sa_data[14]; /* up to 14 bytes of direct address */
};
/* $B%$%s%?!<%M%C%H%"%I%l%9(B */
struct in_addr {
unsigned long s_addr;
};
/* $B%=%1%C%H%"%I%l%9(B */
struct sockaddr_in {
short sin_family;
unsigned short sin_port;
struct in_addr sin_addr;
char sin_zero[8];
};
struct iovec { /* address and length */
char *iov_base; /* base */
int iov_len; /* size */
};
/* recvmsg, sendmsg $BMQ%a%C%;!<%8%X%C%@(B */
struct msghdr { /* Message header for recvmsg and sendmsg. */
char *msg_name; /* optional address */
int msg_namelen; /* size of address */
struct iovec *msg_iov; /* scatter/gather array */
int msg_iovlen; /* # elements in msg_iov */
char *msg_accrights; /* access rights sent/received */
int msg_accrightslen;
};
struct hostent { /* structure for gethostbyname */
char *h_name; /* official name of host */
char **h_aliases; /* alias list */
int h_addrtype; /* host address type */
int h_length; /* length of address */
char **h_addr_list; /* list of addresses from name server */
#define h_addr h_addr_list[0] /* address, for backward compatiblity */
};
struct servent { /* structure for getservbyname */
char *s_name; /* official service name */
char **s_aliases; /* alias list */
int s_port; /* port # */
char *s_proto; /* protocol to use */
};
struct linger { /* structure for the SO_LINGER option */
int l_onoff; /* zero=off, nonzero = on */
int l_linger; /* linger time, in seconds */
};
#define FD_SETSIZE 256
typedef struct fd_set { /* Bit mask for select() */
int fds_bits[FD_SETSIZE/sizeof(int)];
} fd_set;
struct timeval { /* Timeout format for select() */
long tv_sec; /* seconds */
long tv_usec; /* microseconds */
};
3.10.3 $B%(%i!<%3!<%I(B
#define EX_HOSTUNREACH ((-401) << 16) /* $B%[%9%H$,8+$D$+$i$J$$(B */
#define EX_TIMEDOUT ((-402) << 16) /* TCPIP $B%?%$%`%"%&%H(B */
#define EX_CONNABORTED ((-403) << 16) /* $B@\B3$,%"%\!<%H$5$l$?(B */
#define EX_NOBUFS ((-404) << 16) /* TCPIP $BFbItNN0hITB-(B */
#define EX_BADF ((-405) << 16) /* $B%=%1%C%H$,L58z(B */
#define EX_WOULDBLOCK ((-407) << 16) /* $B%V%m%C%/$5$l$k=hM}$,$"$k(B */
#define EX_MSGSIZE ((-408) << 16) /* $BAw?.%a%C%;!<%8$N:YJ,2=$,$G$-$J$$(B */
#define EX_DESTADDRREQ ((-409) << 16) /* $BAw?.@h%"%I%l%9;XDj$,I,MW(B */
#define EX_PROTOTYPE ((-410) << 16) /* $B%W%m%H%3%k$,IT@5(B */
#define EX_NOPROTOOPT ((-411) << 16) /* $BMxMQ$G$-$J$$%W%m%H%3%k;XDj(B */
#define EX_PROTONOSUPPORT ((-412) << 16) /* $BG'<1$5$l$F$$$J$$%*%W%7%g%s;XDj(B */
#define EX_SOCKTNOSUPPORT ((-413) << 16) /* $B%5%]!<%H$5$l$F$$$J$$%=%1%C%H%?%$%W(B */
#define EX_OPNOTSUPP ((-414) << 16) /* $B%5%]!<%H$5$l$F$$$J$$F0:n;XDj(B */
#define EX_PFNOSUPPORT ((-415) << 16) /* $B%5%]!<%H$5$l$F$$$J$$%W%m%H%3%k%U%!%_%j(B */
#define EX_AFNOSUPPORT ((-416) << 16) /* $B%5%]!<%H$5$l$F$$$J$$%"%I%l%9%U%!%_%j(B */
#define EX_ADDRINUSE ((-417) << 16) /* $B%"%I%l%9$O;HMQCf(B */
#define EX_ADDRNOTAVAIL ((-418) << 16) /* $B%"%I%l%9$,MxMQ$G$-$J$$(B */
#define EX_NETDOWN ((-419) << 16) /* $B%M%C%H%o!<%/5!G=$,L58z(B */
#define EX_NETUNREACH ((-420) << 16) /* $B%M%C%H%o!<%/$,8+$D$+$i$J$$(B */
#define EX_NETRESET ((-421) << 16) /* $B%M%C%H%o!<%/$,%j%;%C%H$5$l$?(B */
#define EX_CONNRESET ((-422) << 16) /* $B@\B3$,%j%;%C%H$5$l$?(B */
#define EX_ISCONN ((-423) << 16) /* $B%=%1%C%H$O@\B3:Q$_(B */
#define EX_NOTCONN ((-424) << 16) /* $B%=%1%C%H$O@\B3$5$l$F$$$J$$(B */
#define EX_SHUTDOWN ((-425) << 16) /* $BAw?.$O6X;_$5$l$F$$$k(B */
#define EX_CONNREFUSED ((-426) << 16) /* $B@\B3$,5q@d$5$l$?(B */
#define EX_HOSTDOWN ((-427) << 16) /* $B%[%9%H$,%@%&%s$7$F$$$k(B */
#define EX_ALREADY ((-428) << 16) /* $B4{$K=hM}Cf$NF0:n(B */
#define EX_INPROGRESS ((-429) << 16) /* $BHs%V%m%C%/2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%a!<%?![(B
W s $B%=%1%C%H%G%9%/%j%W%?(B
W cmd $B0J2<(B
F_GETFL $B%G%9%/%j%W%?>uBV%U%i%0$r
$B!Z%j%?!<%sCM![(B
$B!f(B0 $B%U%i%0CM(B(F_GETFL)
$B!c(B0 $B%(%i!<(B
$B!Z2r@b![(B
O_NDELAY
$B$N$_$G$"$k!#(B
O_NDELAY
$B$r;XDj$5$l$?%=%1%C%H$OHs%V%m%C%/>uBV$H$J$j!"(B
$B%=%1%C%H$K4XO"$7$?%7%9%F%`%3!<%k$G$OBT$A$KF~$i$J$/$J$k!#(B
$B!Z%(%i!<%3!<%I![(B
EX_PAR $B%Q%i%a!<%?$,IT@5(B($B%=%1%C%H%G%9%/%j%W%?$NCM$,IT@5(B)
EX_BADF $B%=%1%C%H$,L58z!#(B
so_gethostbyname $BL>A0$K$h$k%[%9%H>pJs$N $B!Z7A<0![(B
ERR so_gethostbyname (B *nam, HOSTENT *hp, B *buf)
$B!Z%Q%i%a!<%?![(B
B* nam $B%[%9%HL>(B
HOSTENT *hp $B%[%9%H>pJs(B
B *buf $B:n6HNN0h(B
$B!Z%j%?!<%sCM![(B
$B!a(B0 $B@5>o(B
$B!c(B0 $B%(%i!<(B
$B!Z2r@b![(B
nam
$B$G;XDj$5$l$?L>A0$r;}$D%[%9%H$K4X$9$k>pJs$r(B
hp
$B$G;XDj$5$l$?NN0h$K3JG<$9$k!#(B
B buf[HBUFLE]
$B$GDj5A$5$l$k:n6HNN0h$r;XDj$9$kI,MW$,$"$k!#(B
hp
$B$,;X$9NN0h$K$O0J2<$N>pJs$,La$5$l$k!#(B
struct hostent { /* structure for gethostbyname */
char *h_name; /* official name of host */
char **h_aliases; /* alias list */
int h_addrtype; /* host address type */
int h_length; /* length of address */
char **h_addr_list; /* list of addresses from nameserver */
#define h_addr h_addr_list[0]
/* address, for backward compatiblity */
};
h_name $B%[%9%H$N@5<0L>(B
h_aliases $B%[%9%H$N%(%$%j%"%9L>(B($B
$B!Z%(%i!<%3!<%I![(B
EX_ADR $B%Q%i%a!<%?$G%"%/%;%9$,5v$5$l$F$$$J$$NN0h$r;2>H$7$F$$$k!#(B
EX_HOSTUNREACH $B;XDj$5$l$?%[%9%H$,8+$D$+$i$J$$!#(B
EX_TIMEDOUT $B%?%$%`%"%&%H!#(B
so_gethostbyaddr $B%"%I%l%9$K$h$k%[%9%H>pJs$N $B!Z7A<0![(B
ERR so_gethostbyaddr (B *addr, W type, W len, HOSTENT *hp, B *buf)
$B!Z%Q%i%a!<%?![(B
B *addr $B%"%I%l%9(B
W type $B%"%I%l%9%?%$%W(B(AF_INET $B$N$_;XDj2DG=(B)
W len $B%"%I%l%9$N%P%$%HD9(B
HOSTENT *hp $B%[%9%H>pJs(B
B *buf $B:n6HNN0h(B
$B!Z%j%?!<%sCM![(B
$B!a(B0 $B@5>o(B
$B!c(B0 $B%(%i!<(B
$B!Z2r@b![(B
hp
$B$G;XDj$5$l$?NN0h$K3JG<$9$k!#(B
B buf[HBUFLE]
$B$GDj5A$5$l$k:n6HNN0h$r;XDj$9$kI,MW$,$"$k!#(B
$B!Z%(%i!<%3!<%I![(B
EX_ADR $B%Q%i%a!<%?$G%"%/%;%9$,5v$5$l$F$$$J$$NN0h$r;2>H$7$F$$$k!#(B
EX_HOSTUNREACH $B;XDj$5$l$?%[%9%H$,8+$D$+$i$J$$(B
ERR so_getpeername $B@\B3Aj $B!Z7A<0![(B
ERR so_getpeername (W s, SOCKADDR *nam, W *namlen)
$B!Z%Q%i%a!<%?![(B
W s $B%=%1%C%H%G%9%/%j%W%?(B
SOCKADDR *nam $B%"%I%l%9(B
W *namlen $B%"%I%l%9$N%P%$%HD9(B
$B!Z%j%?!<%sCM![(B
$B!a(B0 $B@5>o(B
$B!c(B0 $B%(%i!<(B
$B!Z2r@b![(B
namlen
$B$O(B nam
$B$,;X$9NN0h$N%5%$%:$r;XDj$9$k!#(B
$B$B!Z%(%i!<%3!<%I![(B
EX_ADR $B%Q%i%a!<%?$G%"%/%;%9$,5v$5$l$F$$$J$$NN0h$r;2>H$7$F$$$k!#(B
EX_PAR $B%Q%i%a!<%?$,IT@5(B($B%=%1%C%H%G%9%/%j%W%?$NCM$,IT@5(B)
EX_BADF $B%=%1%C%H$,L58z!#(B
EX_FAULT $BL>A0(B($B%"%I%l%9(B)$B$,IT@5!#(B
so_getsockname $B%=%1%C%HL>$N3MF@(B $B!Z7A<0![(B
ERR so_getsockname (W s, SOCKADDR *nam, W *namlen)
$B!Z%Q%i%a!<%?![(B
W s $B%=%1%C%H%G%9%/%j%W%?(B
SOCKADDR *nam $B%"%I%l%9(B
W *namlen $B%"%I%l%9$N%P%$%HD9(B
$B!Z%j%?!<%sCM![(B
$B!a(B0 $B@5>o(B
$B!c(B0 $B%(%i!<(B
$B!Z2r@b![(B
namlen
$B$O(B nam
$B$N%5%$%:$r;XDj$9$k!#(B
$B$B!Z%(%i!<%3!<%I![(B
EX_ADR $B%Q%i%a!<%?$G%"%/%;%9$,5v$5$l$F$$$J$$NN0h$r;2>H$7$F$$$k!#(B
EX_PAR $B%Q%i%a!<%?$,IT@5(B($B%=%1%C%H%G%9%/%j%W%?$NCM$,IT@5(B)
EX_BADF $B%=%1%C%H$,L58z!#(B
EX_FAULT $BL>A0(B($B%"%I%l%9(B)$B$,IT@5!#(B
so_getsockopt $B%=%1%C%H%*%W%7%g%s$N
ERR so_getsockopt (W s, W level, W optnam, B *optval, W *optlen)
W s $B%=%1%C%H%G%9%/%j%W%?(B W level $B%l%Y%k(B W optnam $B%*%W%7%g%s(B B *optval $B%*%W%7%g%sCM(B W *optlen $B%*%W%7%g%s$N%P%$%HD9(B
$B!a(B0 $B@5>o(B $B!c(B0 $B%(%i!<(B
$B%=%1%C%H$K4X$9$k%*%W%7%g%s$r
$B%=%1%C%H$K4X$9$k%*%W%7%g%s$r@_Dj$9$k!#(B
$B%=%1%C%H$K4X$7$FFC
$B%=%1%C%H$Narg $B$r(B
$B%=%1%C%H$,BS0h30%G!<%?$rarg $B$r(B
$B%=%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so_setsockopt $B%=%1%C%H%*%W%7%g%s$N@_Dj(B
ERR so_setsockopt (W s, W level, W optnam, B *optval, W optlen)
$B!Z%Q%i%a!<%?![(B
W s $B%=%1%C%H%G%9%/%j%W%?(B
W level $B%l%Y%k(B
W optnam $B%*%W%7%g%s(B
B *optval $B%*%W%7%g%sCM(B
W *optlen $B%*%W%7%g%s$N%P%$%HD9(B
$B!Z%j%?!<%sCM![(B
$B!a(B0 $B@5>o(B
$B!c(B0 $B%(%i!<(B
$B!Z2r@b![(B
$B%l%Y%k$H%*%W%7%g%s$K$D$$$F$O(B so_getsockopt $B$r;2>H$9$k$3$H!#(B
SOL_SOCKET
$B%l%Y%k$N%*%W%7%g%s$G$O!"(B
$B3F%*%W%7%g%s$,%H%0%k$5$l$k!#(B
IPPROTO_IP
:
IP_OPTIONS optval, optlen
$B$G(B IP $B%*%W%7%g%s$r;XDj(B
IPPROTO_TCP
:
TCP_NODELAY send
$B;~$K%a%C%;!<%8$r$?$@$A$KAw?.$9$k$h$&;XDj(B
SOL_SOCKET
:
SO_DEBUG $B%G%P%C%0>pJs$N5-O?%U%i%0$r%H%0%k(B
SO_RESUSEADDR $B%m!<%+%k%"%I%l%9$N:F;HMQ>uBV$r%H%0%k(B
SO_KEEPALIVE ($BL$%5%]!<%H(B)
SO_DONTROUTE $BH/?.%a%C%;!<%8$N$?$a$N%P%$%Q%9%k!<%H$N7hDj$N%H%0%k(B
SO_BROADCAST $B%V%m!<%I%-%c%9%H%a%C%;!<%8$NAw?.5v2D$r%H%0%k(B
SO_LINGER $B%G!<%?$,$"$k>l9g$N%/%m!<%:$N1d4|$r@_Dj(B
SO_OOBINLINE $BBS0hFb$NBS0h30%G!<%?$NuBV$r%H%0%k(B
SO_SNDBUF $B=PNO$N$?$a$N%P%C%U%!%5%$%:$r@_Dj(B
SO_RCVBUF $BF~NO$N$?$a$N%P%C%U%!%5%$%:$r@_Dj(B
$B!Z%(%i!<%3!<%I![(B
EX_ADR $B%Q%i%a!<%?$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$B%=%1%C%H$,L58z!#(B
so_read $B%=%1%C%H$+$i$N $B!Z7A<0![(B
WERR so_read (W s, B *buf, W len)
$B!Z%Q%i%a!<%?![(B
W s $B%=%1%C%H%G%9%/%j%W%?(B
B *buf $Bu
$B!Z%j%?!<%sCM![(B
$B!f(B0 $B
$B!Z2r@b![(B
so_recv(s, buf, len, 0)
$B$HEy$7$$!#(B
$B!Z%(%i!<%3!<%I![(B
EX_ADR $B%Q%i%a!<%?$G%"%/%;%9$,5v$5$l$F$$$J$$NN0h$r;2>H$7$F$$$k!#(B
EX_PAR $B%Q%i%a!<%?$,IT@5(B($B%=%1%C%H%G%9%/%j%W%?$NCM$,IT@5(B)
EX_BADF $B%=%1%C%H$,L58z!#(B
EX_WOULDBLOCK $B%=%1%C%H$,Hs%V%m%C%/2=$5$l$F$$$F!"
so_recv $B%=%1%C%H$+$i$N $B!Z7A<0![(B
WERR so_recv (W s, B *buf, W len, W flags)
$B!Z%Q%i%a!<%?![(B
W s $B%=%1%C%H%G%9%/%j%W%?(B
B *buf $Be$K$"$k%G!<%?$r!V$N$>$-8+!W$9$k!#(B
$B%G!<%?$OGQ4~$5$l$:!"$=$l0J9_$N
$B!Z%j%?!<%sCM![(B
$B!f(B0 $B
$B!Z2r@b![(B
EX_WOULDBLOCK
$B$rLa$7!"(B
$B$=$l0J30$G$OBT$A$KF~$k!#(B
$B!Z%(%i!<%3!<%I![(B
EX_ADR $B%Q%i%a!<%?$G%"%/%;%9$,5v$5$l$F$$$J$$NN0h$r;2>H$7$F$$$k!#(B
EX_PAR $B%Q%i%a!<%?$,IT@5(B($B%=%1%C%H%G%9%/%j%W%?$NCM$,IT@5(B)
EX_BADF $B%=%1%C%H$,L58z!#(B
EX_WOULDBLOCK $B%=%1%C%H$,Hs%V%m%C%/2=$5$l$F$$$F!"
so_recvfrom $B%=%1%C%H$+$i$N $B!Z7A<0![(B
WERR so_recvfrom (W s, B *buf, W len, W flags, SOCKADDR *from, W *flen)
$B!Z%Q%i%a!<%?![(B
W s $B%=%1%C%H%G%9%/%j%W%?(B
B *buf $Be$K$"$k%G!<%?$r!V$N$>$-8+!W$9$k!#(B
$B%G!<%?$OGQ4~$5$l$:!"$=$l0J9_$N
$B!Z%j%?!<%sCM![(B
$B!f(B0 $B
$B!Z2r@b![(B
EX_WOULDBLOCK
$B$rLa$7!"(B
$B$=$l0J30$G$OBT$A$KF~$k!#(B
from
$B$,(B NULL
$B$G$J$$$H$-$O!"(B
$B%a%C%;!<%8$NH/?.85$N%"%I%l%9$,La$5$l$k!#(B
*flen
$B$O%"%I%l%9$N%5%$%:$r;XDj$7!"(B
$B$B!Z%(%i!<%3!<%I![(B
EX_ADR $B%Q%i%a!<%?$G%"%/%;%9$,5v$5$l$F$$$J$$NN0h$r;2>H$7$F$$$k!#(B
EX_PAR $B%Q%i%a!<%?$,IT@5(B($B%=%1%C%H%G%9%/%j%W%?$NCM$,IT@5(B)
EX_BADF $B%=%1%C%H$,L58z!#(B
EX_WOULDBLOCK $B%=%1%C%H$,Hs%V%m%C%/2=$5$l$F$$$F!"
so_recvmsg $B%=%1%C%H$+$i$N $B!Z7A<0![(B
WERR so_recvmsg (W s, MSGHDR *msg, W flags)
$B!Z%Q%i%a!<%?![(B
W s $B%=%1%C%H%G%9%/%j%W%?(B
MSGHDR *msg $B%a%C%;!<%8%X%C%@!<(B
W flags $B0J2<$N(B OR $B$r;XDj$9$k$3$H$,$G$-$k(B
MSG_OOB $BBS0h30%G!<%?$rFI$_
$B!Z%j%?!<%sCM![(B
$B!f(B0 $B
$B!Z2r@b![(B
EX_WOULDBLOCK
$B$rLa$7!"$=$l0J30$G$OBT$A$KF~$k!#(B
msghdr
$B$G;XDj$9$k$3$H$,$G$-$k!#(B
caddr_t msg_name; $B%*%W%7%g%s$N%"%I%l%9(B
int msg_namelen; $B%"%I%l%9%5%$%:(B
struct iovec *msg_iov; $BG[Ns$NJ,;6(B/$B<}=8(B
int msg_iovlen; msg_iov $B$K$"[email protected]$N?t(B
caddr_t msg_accrights; $BAw?.$^$?$O
msg_name, msg_namelen
$B$KAjNULL
$B$r;XDj$9$k!#(B
msg_iov
$B$K$h$j0l2s$NMW5a$GJ,;6$7$?$$$/$D$+$N>l=j$KFI$_9~$`$3$H$,$G$-$k!#(B
$B!Z%(%i!<%3!<%I![(B
EX_ADR $B%Q%i%a!<%?$G%"%/%;%9$,5v$5$l$F$$$J$$NN0h$r;2>H$7$F$$$k!#(B
EX_PAR $B%Q%i%a!<%?$,IT@5(B($B%=%1%C%H%G%9%/%j%W%?$NCM$,IT@5(B)
EX_BADF $B%=%1%C%H$,L58z!#(B
EX_WOULDBLOCK $B%=%1%C%H$,Hs%V%m%C%/2=$5$l$F$$$F!"
so_select $B%=%1%C%H>uBV$N8!::(B $B!Z7A<0![(B
WERR so_select (W nfds, fd_set *rfds, fd_set *wfds, fd_set *efds,
TIMEVAL *tmout)
$B!Z%Q%i%a!<%?![(B
W nfds $B:GBg%=%1%C%H%G%9%/%j%W%??t(B
fd_set *rfds $B
$B!Z%j%?!<%sCM![(B
$B!d(B0 $B=`Hw$,$G$-$F$$$k%G%9%/%j%W%??t(B
$B!a(B0 $B%?%$%`%"%&%H$7$?!#(B
$B!c(B0 $B%(%i!<(B
$B!Z2r@b![(B
rfds, wfds, efds
$BCf$G=`Hw$,$G$-$F$$$k%=%1%C%H$,$"$k$+$I$&$+8!::$9$k!#(B
rfds, wfds, efds
$B$NFbMF$O!"(B
$B=`Hw$,$G$-$F$$$k$+$I$&$+$N7k2L$,La$5$l$k!#(B
rfds, wfds, efds
$B$O!"(B
$B4XO"$9$k%=%1%C%H$,0l$D$b$J$$>l9g$O!"(B
$B$=$l$>$l(B NULL
$B$r;XDj$9$k$3$H$,$G$-$k!#(B
tmout
$B$,(B NULL
$B$N$H$-$OL58B$KBT$D!#(B
tmout
$B$,(B NULL
$B$G$J$$>l9g$O!"(B
$B$=$3$G;XDj$5$l$?;~4V$@$1BT$D!#(B
$B!Z%(%i!<%3!<%I![(B
EX_ADR $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<%H$5$l$?!#(B
EX_MSGSIZE $BAw?.%a%C%;!<%8%5%$%:$X$N:YJ,2=$,$F$-$J$+$C$?!#(B
EX_NOBUFS $BFbItNN0hITB-!#(B
EX_WOULDBLOCK $B%=%1%C%H$,Hs%V%m%C%/2=$5$l$F$$$k$,!"Aw?.$K$h$jBT$A$K$O$$$k!#(B
EX_TIMEOUT $B%?%$%`%"%&%H!#(B
EX_HOSTUNREACH $B;XDj$5$l$?Aw?.@h$,8+$D$+$i$J$$!#(B
so_shutdown $BA4Fs=E@\B3$NItJ,%7%c%C%H%@%&%s(B $B!Z7A<0![(B
ERR so_shutdown (W s, W how)
$B!Z%Q%i%a!<%?![(B
W s $B%=%1%C%H%G%9%/%j%W%?(B
W how $B$3$l0J9_$NAw
$B!Z%j%?!<%sCM![(B
$B!Z2r@b![(B
$B!Z%(%i!<%3!<%I![(B
EX_NOBUFS
EX_PAR $B%Q%i%a!<%?$,IT@5(B($B%=%1%C%H%G%9%/%j%W%?$NCM$,IT@5(B)
EX_BADF $B%=%1%C%H$,L58z!#(B
so_socket $BDL?.MQ$N=*E@$N:n@.(B $B!Z7A<0![(B
WERR so_socket (W domain, W type, W protocol)
$B!Z%Q%i%a!<%?![(B
W domain $BDL?.$r9T$J$&%I%a%$%s(B
PF_INET
PF_UNSPEC (PF_INET $B$H$7$F07$o$l$k(B)
W type $BDL?.$N%?%$%W(B
SOCK_STREAM
SOCK_DGRAM
W protocol $B%W%m%H%3%k(B
TCP (SOCK_STREAM $B%?%$%W$N;~(B)
UDP (SOCK_DGRAM $B%?%$%W$N;~(B)
ICMP (SOCK_DGRAM $B%?%$%W$N;~(B)
$B!Z%j%?!<%sCM![(B
$B!f(B0 $B%=%1%C%H%G%9%/%j%W%?(B
$B!c(B0 $B%(%i!<(B
$B!Z2r@b![(B
$B!Z%(%i!<%3!<%I![(B
EX_NOBUFS $BFbItNN0hITB-!#(B
EX_PROTONOSUPPORT $B%5%]!<%H$5$l$F$$$J$$%?%$%W$^$?$O%W%m%H%3%k!#(B
so_gethostname $B%[%9%HL>$N
ERR so_gethostname (B *name, W nlen)
$B!Z%Q%i%a!<%?![(B
B *name $B%[%9%HL>$r3JG<$9$kNN0h(B
W nlen name $B$N%P%$%HD9(B
$B!Z%j%?!<%sCM![(B
$B!a(B0 $B@5>o(B
$B!c(B0 $B%(%i!<(B
$B!Z2r@b![(B
$B!Z%(%i!<%3!<%I![(B
EX_ADR $B%Q%i%a!<%?$G%"%/%;%9$,5v$5$l$F$$$J$$NN0h$r;2>H$7$F$$$k!#(B
so_sethostname $B%[%9%HL>$N@_Dj(B $B!Z7A<0![(B
ERR so_sethostname (B *name, W nlen)
$B!Z%Q%i%a!<%?![(B
B *name $B%[%9%HL>(B
W nlen $B%[%9%HL>$N%P%$%HD9(B
$B!Z%j%?!<%sCM![(B
$B!a(B0 $B@5>o(B
$B!c(B0 $B%(%i!<(B
$B!Z2r@b![(B
$B!Z%(%i!<%3!<%I![(B
EX_ADR $B%Q%i%a!<%?$G%"%/%;%9$,5v$5$l$F$$$J$$NN0h$r;2>H$7$F$$$k!#(B
$B$3$N>O$NL\
$BA0JG(B:3.9 $B%U%)%s%H%^%M!<%8%c$K$b$I$k(B
$B