tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: read side of pipe and poll() events

On Fri, 19 Feb 2010, john heasley wrote:

> poll(2) reads:
>      POLLHUP        The device or socket has been disconnected.  This flag is
>                     always checked, even if not present in the events bitmask.
>                     Note that POLLHUP and POLLOUT should never be present in
>                     the revents bitmask at the same time.  If the remote end
>                     of a socket is closed, poll() returns a POLLIN event,
>                     rather than a POLLHUP.
> I believe, and the pipe_poll() seems to confirm, that POLLIN and POLLHUP
> are NOT mutually exclusive in the case of the read side of a pipe reaching
> EOF.  That both, and POLLRDNORM if requested, are set.  Which is correct?

I'm not sure what you are asking. The above paragraph doesn't mention
POLLIN wrt pipes. It does say that when a *socket* is closed from the
remote end, you will get a POLLIN rather than POLLHUP.

pipe != socket && in != out ?


Home | Main Index | Thread Index | Old Index