- 论坛徽章:
- 0
|
一个困惑很久的问题
比如调用一个函数connect,出错了系统把返回码放到errno当中
现在系统返回的errno值是60
但我查看手册man connect只有这些值的宏定义
ERRORS
The connect() system call fails if:
[EBADF] The s argument is not a valid descriptor.
[ENOTSOCK] The s argument is a descriptor for a file, not a
socket.
[EADDRNOTAVAIL] The specified address is not available on this
machine.
[EAFNOSUPPORT] Addresses in the specified address family cannot be
used with this socket.
[EISCONN] The socket is already connected.
--------------
我如何知道返回值60是EBADF,ENOTSOCK或EAFNOSUPPORT中的哪一个?
可能这是个很简单的问题,但我已经头痛很久了,我每次都要去找到头文件中看定义,但有时头文件层层包含根本找不到定义的地方。
一定有简单办法查看这些宏和对应值的对照表吧,请告诉我。 |
|