After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 141251 - poll(2) is in <poll.h>, not <sys/poll.h> per SUS standard
poll(2) is in <poll.h>, not <sys/poll.h> per SUS standard
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: mainloop
2.4.x
Other other
: Low normal
: ---
Assigned To: gtkdev
gtkdev
: 131257 141252 (view as bug list)
Depends on:
Blocks: 141253
 
 
Reported: 2004-04-28 02:08 UTC by Todd Vierling
Modified: 2013-12-22 16:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use POSIX-specified <poll.h> over <sys/poll.h> (4.70 KB, patch)
2013-10-28 23:50 UTC, Allison Karlitskaya (desrt)
needs-work Details | Review
Use POSIX-specified <poll.h> over <sys/poll.h> (4.56 KB, patch)
2013-10-29 01:26 UTC, Allison Karlitskaya (desrt)
accepted-commit_now Details | Review
Use POSIX-specified <poll.h> over <sys/poll.h> (4.28 KB, patch)
2013-12-22 16:35 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Todd Vierling 2004-04-28 02:08:18 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.
Comment 1 Owen Taylor 2004-04-28 02:16:50 UTC
*** Bug 141252 has been marked as a duplicate of this bug. ***
Comment 2 Todd Vierling 2004-04-28 14:15:56 UTC
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.
Comment 3 Matthias Clasen 2005-01-20 19:57:10 UTC
*** Bug 131257 has been marked as a duplicate of this bug. ***
Comment 4 Markus Duft 2011-06-10 13:04:42 UTC
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/
Comment 5 Allison Karlitskaya (desrt) 2013-10-28 23:50:47 UTC
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 6 Dan Winship 2013-10-29 01:14:31 UTC
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.
Comment 7 Allison Karlitskaya (desrt) 2013-10-29 01:15:37 UTC
I indeed posit that if we have poll() we'll find it in poll.h.

Will do another round.
Comment 8 Allison Karlitskaya (desrt) 2013-10-29 01:26:39 UTC
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.
Comment 9 Matthias Clasen 2013-11-24 01:52:12 UTC
patch doesn't apply anymore after the recent portability shmortability commits.
Comment 10 Allison Karlitskaya (desrt) 2013-12-22 16:35:17 UTC
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.
Comment 11 Allison Karlitskaya (desrt) 2013-12-22 16:42:02 UTC
Attachment 264759 [details] pushed as 3f41e49 - Use POSIX-specified <poll.h> over <sys/poll.h>