网络API 索引: 1
字节序函数 2
字节操作函数 3
地址转换函数 4
readn、writen和 readline 5
测试描述符类型 6
socket函数 7
connect函数 8
bind函数 9
listen函数 10
accept函数 11
close函数 12
getsockname和 getpeername 13
select函数 14
shutdown函数 15
pselect函数 16
poll函数 17
getsockopt和 setsockopt 18
套接口选项列表 19
处理套接口的 fcntl函数 20
gethostbyname函数 21
gethostbyname2函数 22
ethostbyaddr函数 23
uname函数 24
gethostname函数 25
getservbyname函数 26
getservbyport函数 27
recv和 send 28
readv和 writev 29
readmsg和 writemsg 30
socketpair函数 31
套接口 ioctl函数 1
字节序函数 #include uint16_t htons(uint16_t host16bitvalue); uint32_t htonl(uint32_t host32bitvalue); 返回:网络字节序值 uint16_t ntohs(uint16_t net16bitvalue); uint32_t ntohl(uint32_t net32bitvalue); 返回:主机字节序值 一个测试本机字节序的程序,可参见见unpv12e:intro/byteorder
字节操作函数 #include void bzero(void *dest, size_t nbytes); void bcopy(const void *sr