- 论坛徽章:
- 1
|
本帖最后由 lewy7 于 2016-02-23 14:17 编辑
回复 10# lxyscls
原来如此,非常感谢。我原来只盯着select的返回值了,然后man到select的
RETURN VALUE
On success, select() and pselect() return the number of file descriptors contained in the three returned descriptor sets (that is, the total
number of bits that are set in readfds, writefds, exceptfds) which may be zero if the timeout expires before anything interesting happens. On
error, -1 is returned, and errno is set appropriately; the sets and timeout become undefined, so do not rely on their contents after an error.
ERRORS
EBADF An invalid file descriptor was given in one of the sets. (Perhaps a file descriptor that was already closed, or one on which an error
has occurred.)
看到EBADF,一直想把这个错误的fd找出来。 |
|