在C中调用套接字函数时,是否返回0或1作为套接字描述符的值?对于socket()函数调用,返回0或1的有效值
int socket(int domain, int type, int protocol);
据该男子的网页我有:
RETURN VALUE
-1 is returned if an error occurs; otherwise the return value is a
descriptor referencing the socket.
这似乎是它可以,或者至少手册页并没有提及任何保留值。它写在别的地方,有效的套接字描述符需要是2或更大?
我特别在Linux 2.4.22内核上运行,但我很想知道任何基于Unix的套接字实现。