1#pragma once 2 3#ifdef __cplusplus 4extern "C" { 5#endif 6 7#include <features.h> 8 9#include <bits/poll.h> 10 11#define POLLIN 0x001 12#define POLLPRI 0x002 13#define POLLOUT 0x004 14#define POLLERR 0x008 15#define POLLHUP 0x010 16#define POLLNVAL 0x020 17#define POLLRDNORM 0x040 18#define POLLRDBAND 0x080 19#ifndef POLLWRNORM 20#define POLLWRNORM 0x100 21#define POLLWRBAND 0x200 22#endif 23#ifndef POLLMSG 24#define POLLMSG 0x400 25#define POLLRDHUP 0x2000 26#endif 27 28typedef unsigned long nfds_t; 29 30struct pollfd { 31 int fd; 32 short events; 33 short revents; 34}; 35 36int poll(struct pollfd*, nfds_t, int); 37 38#ifdef _GNU_SOURCE 39#define __NEED_time_t 40#define __NEED_struct_timespec 41#define __NEED_sigset_t 42#include <bits/alltypes.h> 43int ppoll(struct pollfd*, nfds_t, const struct timespec*, const sigset_t*); 44#endif 45 46#ifdef __cplusplus 47} 48#endif 49