select, semop 等阻塞的系统调用返回值的检查

来源:互联网 发布:阿里云邮箱服务器地址 编辑:程序博客网 时间:2024/06/16 07:31

最近工作实现一个 7 * 24 小时的服务程序, 经常出现 "semop: Interrupted system call",  "select failed: Interrupted system call". 

经查是因为在 select, semop 的返回值为 -1 时没有对 errno 进行检查.

如果 "errno == EINTR", 则应该 continue.

这篇文章说得很好: http://blog.csdn.net/yin138/article/details/4366609

原创粉丝点击