GNOME Bugzilla – Bug 141251
poll(2) is in <poll.h>, not <sys/poll.h> per SUS standard
Last modified: 2013-12-22 16:42:05 UTC
Compile GLib2 on Interix 3.5, which has <poll.h> but no <sys/poll.h>. Fail because the poll() symbol was found by "configure", but no header file was included when compiling gmain.c to get the POLL* constants and prototype. The Single Unix Specification standard explicitly states that these definitions are in <poll.h>, not <sys/poll.h>. But, it's possible that older systems only have <sys/poll.h>. Fix: Add "poll.h" to the list of headers searched in configure.in, and if present (HAVE_POLL_H), use that *in preference to* <sys/poll.h> in gmain.c.
*** Bug 141252 has been marked as a duplicate of this bug. ***
It turns out that poll(2) is nonfunctional as of Interix 3.5 anyway, so I've bumped the priority on this way down. The issue still stands as standards noncompliance, but that's more of an enhancement request.
*** Bug 131257 has been marked as a duplicate of this bug. ***
there is a library called suacomp [1] (which is installed by default on gentoo prefix for interix), which brings a working poll(). as of the patch in 652285, i can confirm, that it (mostly) does what it should :) [1] https://sourceforge.net/projects/suacomp/
Created attachment 258369 [details] [review] Use POSIX-specified <poll.h> over <sys/poll.h> POSIX specifies that <poll.h> is the correct header to include for poll(), so let's do that instead.
Comment on attachment 258369 [details] [review] Use POSIX-specified <poll.h> over <sys/poll.h> If we're assuming that all systems that have poll() will have it in <poll.h>, then there's no need to check for HAVE_POLL_H, since we're already checking HAVE_POLL. If we're not assuming that, then we need to check for both <poll.h> and <sys/poll.h>, and include whichever one is available.
I indeed posit that if we have poll() we'll find it in poll.h. Will do another round.
Created attachment 258382 [details] [review] Use POSIX-specified <poll.h> over <sys/poll.h> POSIX specifies that <poll.h> is the correct header to include for poll(), so let's do that instead.
patch doesn't apply anymore after the recent portability shmortability commits.
Created attachment 264759 [details] [review] Use POSIX-specified <poll.h> over <sys/poll.h> POSIX specifies that <poll.h> is the correct header to include for poll(), so let's do that instead. Rebased so that it applies again.
Attachment 264759 [details] pushed as 3f41e49 - Use POSIX-specified <poll.h> over <sys/poll.h>