poll()-ing a pipe descriptor, watching for POLLHUP
Kostik Belousov
kostikbel at gmail.com
Wed Jun 3 12:32:14 UTC 2009
On Wed, Jun 03, 2009 at 03:15:32PM +0300, Vlad Galu wrote:
> Hello,
>
> Please take a look at the attached code. Shouldn't poll() get a
> POLLHUP event when the child process exits, closing the write end of
> the pipe?
It seems that you code forgot to close the write end of the pipe in
parent. Thus, pipe is referenced by another file descriptor from
the parent process, and you do not get close event.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20090603/d6f14751/attachment.pgp
More information about the freebsd-stable
mailing list