Subject: poll(2) question
To: None <current-users@netbsd.org>
From: john heasley <heas@shrubbery.net>
List: current-users
Date: 06/25/2002 11:09:55
according to the poll(2) manpage, POLLIN will be returned when the
remote end of a socket (pipe as well?) has been closed and (presumably)
data remains to be read.

in my case, i expect that the remote has long since closed the pipe and
exited by the time i get around to reading.  however, when i poll stdin
(pipe from the other program) i get

$2 = {fd = 0x0, events = 0x41, revents = 0x51}

poll.h:
#define POLLIN          0x0001
#define POLLRDNORM      0x0040
/*
 * Non-testable events (may not be specified in events field).
 */
#define POLLHUP         0x0010

btw, "non-testable events" seems like an awefully odd wording.

indeed, this agress with sys_pipe:pipe_poll() code.  which is correct?
the code, i believe.  according to the single unix spec

"... However, this event and POLLIN, POLLRDNORM, POLLRDBAND, or POLLPRI
 are not mutually-exclusive."