xref: /haiku/headers/posix/poll.h (revision c698a51ee009dcd9509e517f407b4d4b0fb21852)
1 #ifndef _POLL_H
2 #define _POLL_H
3 /*
4 ** Distributed under the terms of the OpenBeOS License.
5 */
6 
7 typedef unsigned long nfds_t;
8 
9 struct pollfd {
10 	int		fd;
11 	short	events;		/* events to look for */
12 	short	revents;	/* events that occured */
13 };
14 
15 /* events & revents - compatible with the B_SELECT_xxx definitions in Drivers.h */
16 #define	POLLIN		0x0001		/* any readable data available */
17 #define	POLLOUT		0x0002		/* file descriptor is writeable */
18 #define	POLLRDNORM	POLLIN
19 #define	POLLWRNORM	POLLOUT
20 #define	POLLRDBAND	0x0008		/* priority readable data */
21 #define	POLLWRBAND	0x0010		/* priority data can be written */
22 #define	POLLPRI		0x0020		/* high priority readable data */
23 
24 /* revents only */
25 #define	POLLERR		0x0004		/* errors pending */
26 #define	POLLHUP		0x0080		/* disconnected */
27 #define	POLLNVAL	0x1000		/* invalid file descriptor */
28 
29 
30 extern
31 #ifdef __cplusplus
32 "C"
33 #endif
34 int poll(struct pollfd *fds, nfds_t numfds, int timeout);
35 
36 #endif /* _POLL_H */
37