1 /* 2 * Copyright (C) 2021 Alibaba Group Holding Limited 3 */ 4 5 #ifndef _POLL_H 6 #define _POLL_H 7 8 #ifdef __cplusplus 9 extern "C" { 10 #endif 11 12 #ifndef POLLIN 13 #define POLLIN 0x001 14 #endif 15 #ifndef POLLOUT 16 #define POLLOUT 0x004 17 #endif 18 #ifndef POLLERR 19 #define POLLERR 0x008 20 #endif 21 22 typedef int nfds_t; 23 24 struct pollfd { 25 int fd; /* file descriptor */ 26 short events; /* requested events */ 27 short revents; /* returned events */ 28 }; 29 30 int poll(struct pollfd fds[], nfds_t nfds, int timeout); 31 32 #ifdef __cplusplus 33 } 34 #endif 35 36 #endif /*_POLL_H*/ 37