Ticket #2037: sys_poll.patch

File sys_poll.patch, 2.4 KB (added by mjw, 17 years ago)
  • headers/posix/poll.h

     
    11#ifndef _POLL_H
    22#define _POLL_H
    33/*
    4 ** Distributed under the terms of the OpenBeOS License.
     4** Distributed under the terms of the MIT License.
    55*/
    66
    7 typedef unsigned long nfds_t;
     7#include <sys/poll.h>
    88
    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"
    339#endif
    34 int poll(struct pollfd *fds, nfds_t numfds, int timeout);
    35 
    36 #endif /* _POLL_H */
  • headers/posix/sys/poll.h

     
     1#ifndef _SYS_POLL_H
     2#define _SYS_POLL_H
     3/*
     4** Distributed under the terms of the OpenBeOS License.
     5*/
     6
     7typedef unsigned long nfds_t;
     8
     9struct 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
     30extern
     31#ifdef __cplusplus
     32"C"
     33#endif
     34int poll(struct pollfd *fds, nfds_t numfds, int timeout);
     35
     36#endif /* _POLL_H */