Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#2037 closed enhancement (fixed)

Please add <sys/poll.h>

Reported by: mjw Owned by: axeld
Priority: normal Milestone: R1
Component: System/libroot.so Version: R1/pre-alpha1
Keywords: Cc: nielx
Blocked By: Blocking:
Platform: All

Description

This may be a bit controversial, but I'll give it a go anyway...

Most documentation for poll() states that programs using poll() should #include <poll.h>. However, this rule seems to be more honoured in the breech than the observance, with a lot of 3rd party code #including <sys/poll.h>. Haiku does not have <sys/poll.h>, so 3rd party code that #includes <sys/poll.h> needs to be modified to compile.

Posix OSs that I have seen (Linux, Solaris and NetBSD) have the main poll() header in <sys/poll.h>. <poll.h> either #includes, or is a symbolic link to, <sys/poll.h>.

I have attached a patch that makes Haiku emulate Linux/Solaris semantics: <poll.h> #includes <sys/poll.h>. This patch should not break existing Haiku/BeOS software, and will allow 3rd party apps to be ported with less modifications.

Any chance of it being applied?

Attachments (1)

sys_poll.patch (2.4 KB ) - added by mjw 16 years ago.

Download all attachments as: .zip

Change History (7)

by mjw, 16 years ago

Attachment: sys_poll.patch added

comment:1 by nielx, 16 years ago

I'd like to second this. Also python assumes it is in sys/poll.h.

comment:2 by nielx, 16 years ago

Cc: nielx added

comment:3 by axeld, 16 years ago

Resolution: fixed
Status: newclosed

poll.h is a POSIX header, while sys/poll.h is not. I would always prefer to fix broken software which is not POSIX conformant for no reason. Anyway, I've added a sys/poll.h header in hrev24864 that includes the POSIX poll.h header now. If that isn't okay for you, please tell.

comment:4 by kaliber, 16 years ago

BTW. It's a duplicate of bug 1125 marked as invalid...

comment:5 by mjw, 16 years ago

Thanks Axel. Sounds like a reasonable compromise.

comment:6 by nielx, 16 years ago

Considering this is not standard POSIX, I agree with Axel that the tool needs to be fixed. I will try to work it in.

N.

Note: See TracTickets for help on using tickets.