/*
- * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#ifndef _SYS_POLL_H_
#define _SYS_POLL_H_
-#include <sys/appleapiopts.h>
-
-#ifdef __APPLE_API_PRIVATE
/*
* This file is intended to be compatable with the traditional poll.h.
*/
/*
* Requestable events. If poll(2) finds any of these set, they are
* copied to revents on return.
- * XXX Note that FreeBSD doesn't make much distinction between POLLPRI
- * and POLLRDBAND since none of the file types have distinct priority
- * bands - and only some have an urgent "mode".
- * XXX Note POLLIN isn't really supported in true SVSV terms. Under SYSV
- * POLLIN includes all of normal, band and urgent data. Most poll handlers
- * on FreeBSD only treat it as "normal" data.
*/
#define POLLIN 0x0001 /* any readable data available */
#define POLLPRI 0x0002 /* OOB/Urgent readable data */
/*
* FreeBSD extensions: polling on a regular file might return one
- * of these events (currently only supported on UFS).
+ * of these events (currently only supported on local filesystems).
*/
#define POLLEXTEND 0x0200 /* file may have been extended */
#define POLLATTRIB 0x0400 /* file attributes may have changed */
#define POLLSTANDARD (POLLIN|POLLPRI|POLLOUT|POLLRDNORM|POLLRDBAND|\
POLLWRBAND|POLLERR|POLLHUP|POLLNVAL)
-#endif /* __APPLE_API_PRIVATE */
+struct pollfd
+{
+ int fd;
+ short events;
+ short revents;
+};
+
+typedef unsigned int nfds_t;
+
+#if !defined(KERNEL)
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+/*
+ * This is defined here (instead of <poll.h>) because this is where
+ * traditional SVR4 code will look to find it.
+ */
+extern int poll (struct pollfd *, nfds_t, int);
+
+__END_DECLS
+
+#endif /* !KERNEL */
#endif /* !_SYS_POLL_H_ */