From f93086c8b29427a07d331930687ca0cca7a9f299 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 28 Oct 2002 18:46:30 +0000 Subject: [PATCH] Completed the poll.h header file. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1738 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/posix/poll.h | 46 ++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/headers/posix/poll.h b/headers/posix/poll.h index b7f7a9a0f4..945dd447e3 100644 --- a/headers/posix/poll.h +++ b/headers/posix/poll.h @@ -1,32 +1,36 @@ -/* poll.h - * - * poll is an alternative way to deal with system notification - * of events on sockets - */ +#ifndef _POLL_H +#define _POLL_H +/* +** Distributed under the terms of the OpenBeOS License. +*/ -#ifndef __POLL_H -#define __POLL_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define POLLIN 0x0001 -#define POLLPRI 0x0002 /* not used */ -#define POLLOUT 0x0004 -#define POLLERR 0x0008 +typedef unsigned long nfds_t; struct pollfd { int fd; - int events; /* events to look for */ + int events; /* events to look for */ int revents; /* events that occured */ }; -extern int poll(struct pollfd * p, int nb, int timeout); +/* events & revents */ +#define POLLIN 0x0001 /* any readable data available */ +#define POLLPRI 0x0002 /* high priority readable data */ +#define POLLOUT 0x0004 /* file descriptor is writeable */ +#define POLLRDNORM 0x0040 /* normal data available */ +#define POLLRDBAND 0x0080 /* priority readable data */ +#define POLLWRNORM POLLOUT +#define POLLWRBAND 0x0100 /* priority data can be written */ +/* revents only */ +#define POLLERR 0x0008 /* errors pending */ +#define POLLHUP 0x0010 /* disconnected */ +#define POLLNVAL 0x0020 /* invalid file descriptor */ + + +extern #ifdef __cplusplus -} +"C" #endif +int poll(struct pollfd *fds, nfds_t numfds, int timeout); -#endif /* __POLL_H */ - +#endif /* _POLL_H */