+2012-09-13 Joachim Schmitz <jojo@schmitz-digital.de> (tiny change)
+ Paolo Bonzini <bonzini@gnu.org>
+
+ poll: fix for systems that can't recv() on a non-socket
+ * lib/poll.c: if recv returns ENOTSOCK, assume the descriptor
+ is readable. In this case POLLHUP will not be supported.
+ * doc/posix-functions/poll.texi: Document this.
+
2012-09-13 Paolo Bonzini <bonzini@gnu.org>
poll/select: document portability problems not fixed by Gnulib.
@itemize
@item
This function is missing on some platforms:
-mingw, MSVC 9, BeOS.
+mingw, MSVC 9, BeOS, HP NonStop.
@item
This function doesn't work on special files like @file{/dev/null} and ttys like
@file{/dev/tty} on some platforms:
Under Windows, when passing a pipe, Gnulib's @code{poll} replacement might
return 0 even before the timeout has passed. Programs using it with pipes can
thus busy wait.
+
+@item
+Under HP NonStop, file descriptors other than sockets do not support
+POLLHUP; they will return a "readable" status instead.
@end itemize
|| socket_errno == ECONNABORTED || socket_errno == ENETRESET)
happened |= POLLHUP;
+ /* some systems can't use recv() on non-socket, including HP NonStop */
+ else if (socket_errno == ENOTSOCK)
+ happened |= (POLLIN | POLLRDNORM) & sought;
+
else
happened |= POLLERR;
}