summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormike <mike@FreeBSD.org>2002-07-08 16:37:35 +0000
committermike <mike@FreeBSD.org>2002-07-08 16:37:35 +0000
commit2363974e0c8427799636701e0abdf9f903a37253 (patch)
treed646705a81fac9fb2edf44af8e65b0607d752422 /sys
parent15fec8826f204426ea2047752753b76078c52730 (diff)
downloadFreeBSD-src-2363974e0c8427799636701e0abdf9f903a37253.zip
FreeBSD-src-2363974e0c8427799636701e0abdf9f903a37253.tar.gz
Bring poll.h up to conformance with POSIX.1-2001 by adding some
visibility conditionals, adding the nfds_t type, and changing the poll() prototype a little. Update the manual to match.
Diffstat (limited to 'sys')
-rw-r--r--sys/sys/poll.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/sys/sys/poll.h b/sys/sys/poll.h
index 383cd0d..89cadc6 100644
--- a/sys/sys/poll.h
+++ b/sys/sys/poll.h
@@ -31,10 +31,14 @@
#ifndef _SYS_POLL_H_
#define _SYS_POLL_H_
+#include <sys/cdefs.h>
+
/*
* This file is intended to be compatible with the traditional poll.h.
*/
+typedef unsigned int nfds_t;
+
/*
* This structure is passed as an array to poll(2).
*/
@@ -63,7 +67,9 @@ struct pollfd {
#define POLLWRBAND 0x0100 /* OOB/Urgent data can be written */
/* General FreeBSD extension (currently only supported for sockets): */
+#if __BSD_VISIBLE
#define POLLINIGNEOF 0x2000 /* like POLLIN, except ignore EOF */
+#endif
/*
* These events are set if they occur regardless of whether they were
@@ -73,6 +79,8 @@ struct pollfd {
#define POLLHUP 0x0010 /* file descriptor was "hung up" */
#define POLLNVAL 0x0020 /* requested events "invalid" */
+#if __BSD_VISIBLE
+
#define POLLSTANDARD (POLLIN|POLLPRI|POLLOUT|POLLRDNORM|POLLRDBAND|\
POLLWRBAND|POLLERR|POLLHUP|POLLNVAL)
@@ -83,18 +91,12 @@ struct pollfd {
*/
#define INFTIM (-1)
-#ifndef _KERNEL
+#endif
-#include <sys/cdefs.h>
+#ifndef _KERNEL
__BEGIN_DECLS
-/*
- * XXX logically, poll() should be declared in <poll.h>, but SVR4 at
- * least has it here in <sys/poll.h>.
- * XXX poll() has "unsigned long" nfds on SVR4, not unsigned as on the
- * other BSDs.
- */
-int poll(struct pollfd *_pfd, unsigned int _nfds, int _timeout);
+int poll(struct pollfd _pfd[], nfds_t _nfds, int _timeout);
__END_DECLS
#endif /* !_KERNEL */
OpenPOWER on IntegriCloud