diff options
-rw-r--r-- | lib/libc/sys/poll.2 | 5 | ||||
-rw-r--r-- | sys/sys/poll.h | 20 |
2 files changed, 13 insertions, 12 deletions
diff --git a/lib/libc/sys/poll.2 b/lib/libc/sys/poll.2 index 04a91df..df306e7 100644 --- a/lib/libc/sys/poll.2 +++ b/lib/libc/sys/poll.2 @@ -28,7 +28,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd September 7, 1996 +.Dd July 8, 2002 .Dt POLL 2 .Os .Sh NAME @@ -37,10 +37,9 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In poll.h .Ft int -.Fn poll "struct pollfd *fds" "unsigned int nfds" "int timeout" +.Fn poll "struct pollfd fds[]" "nfds_t nfds" "int timeout" .Sh DESCRIPTION .Fn Poll examines a set of file descriptors to see if some of them are ready for 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 */ |