套接字函数调用C可以返回0或1作为套接字描述符的值吗?
int socket(int domain, int type, int protocol);
Run Code Online (Sandbox Code Playgroud)
根据我的手册页:
RETURN VALUE
-1 is returned if an error occurs; otherwise the return value is a
descriptor referencing the socket.
Run Code Online (Sandbox Code Playgroud)
它似乎可以,或者至少手册页没有提到任何保留值.是否在其他地方写入了有效套接字描述符需要为2或更大?
我专门在linux 2.4.22内核上运行,但我很想知道任何基于unix的socket实现.
| 归档时间: |
|
| 查看次数: |
10977 次 |
| 最近记录: |