diff options
| author | bernard <[email protected]> | 2017-10-17 22:27:06 +0800 |
|---|---|---|
| committer | bernard <[email protected]> | 2017-10-17 22:27:06 +0800 |
| commit | 8a38307e2cce628017e9eb7153ae7a2430a3d9ef (patch) | |
| tree | 1eb4cfdceddb9c542806acf226d463de62271abb /components/dfs/include/dfs_poll.h | |
| parent | 947d8aa4d2d0742eb5ac1968406893f4e58a279b (diff) | |
[libc] Add RT_USING_POSIX macro.
1. Add macro check in rtdebug.h;
2. Use RT_USING_POSIX for poll/select, stdin etc.
3. Split dfs_posix.h to dfs_posix.h, dfs_poll.h and dfs_select.h;
Diffstat (limited to 'components/dfs/include/dfs_poll.h')
| -rw-r--r-- | components/dfs/include/dfs_poll.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/components/dfs/include/dfs_poll.h b/components/dfs/include/dfs_poll.h new file mode 100644 index 0000000000..cfdf74fbe4 --- /dev/null +++ b/components/dfs/include/dfs_poll.h @@ -0,0 +1,37 @@ +#ifndef DFS_POLL_H__ +#define DFS_POLL_H__ + +#include <rtthread.h> + +#ifdef RT_USING_POSIX +#include <sys/time.h> /* for struct timeval */ + +#define POLLIN (0x01) +#define POLLRDNORM (0x01) +#define POLLRDBAND (0x01) +#define POLLPRI (0x01) + +#define POLLOUT (0x02) +#define POLLWRNORM (0x02) +#define POLLWRBAND (0x02) + +#define POLLERR (0x04) +#define POLLHUP (0x08) +#define POLLNVAL (0x10) + +#define POLLMASK_DEFAULT (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM) + +typedef unsigned int nfds_t; + +struct pollfd +{ + int fd; + short events; + short revents; +}; + +int poll(struct pollfd *fds, nfds_t nfds, int timeout); +#endif + +#endif + |
