1 /* 2 * Copyright (c) 2006-2018, RT-Thread Development Team 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Change Logs: 7 * Date Author Notes 8 */ 9 10 #ifndef DFS_POLL_H__ 11 #define DFS_POLL_H__ 12 13 #include <rtthread.h> 14 15 #ifdef RT_USING_POSIX 16 #include <sys/time.h> /* for struct timeval */ 17 18 #if !defined(POLLIN) && !defined(POLLOUT) 19 #define POLLIN (0x01) 20 #define POLLRDNORM (0x01) 21 #define POLLRDBAND (0x01) 22 #define POLLPRI (0x01) 23 24 #define POLLOUT (0x02) 25 #define POLLWRNORM (0x02) 26 #define POLLWRBAND (0x02) 27 28 #define POLLERR (0x04) 29 #define POLLHUP (0x08) 30 #define POLLNVAL (0x10) 31 32 typedef unsigned int nfds_t; 33 34 struct pollfd 35 { 36 int fd; 37 short events; 38 short revents; 39 }; 40 #endif /* !defined(POLLIN) && !defined(POLLOUT) */ 41 42 #define POLLMASK_DEFAULT (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM) 43 int poll(struct pollfd *fds, nfds_t nfds, int timeout); 44 #endif /* RT_USING_POSIX */ 45 46 #endif /* DFS_POLL_H__ */ 47