【发布时间】:2014-09-28 14:37:11
【问题描述】:
手册页说 poll(2):
POLLHUP - 挂断(仅输出)
POLLNVAL - 无效请求:fd 未打开(仅输出)
到底有什么区别?编写一个简单的程序表明,如果我关闭文件描述符,POLLNVAL 将触发,然后尝试从关闭的 fd 中读取。但是,我无法找到返回 POLLHUP 的方法。
【问题讨论】:
-
这是我的
man页面所说的:POLLHUP The device or socket has been disconnected. This flag is output only, and ignored if present in the input events bitmask. Note that POLLHUP and POLLOUT are mutually exclusive and should never be present in the revents bitmask at the same time.
标签: c unix pipe poll-syscall