免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: lewy7
打印 上一主题 下一主题

[函数] select返回-1的问题 [复制链接]

论坛徽章:
1
15-16赛季CBA联赛之深圳
日期:2016-02-17 16:12:23
11 [报告]
发表于 2016-02-23 14:14 |只看该作者
本帖最后由 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找出来。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP