diff options
Diffstat (limited to 'src/corelib/kernel/qcore_unix_p.h')
-rw-r--r-- | src/corelib/kernel/qcore_unix_p.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/corelib/kernel/qcore_unix_p.h b/src/corelib/kernel/qcore_unix_p.h index d82b2651e7..d5434888d0 100644 --- a/src/corelib/kernel/qcore_unix_p.h +++ b/src/corelib/kernel/qcore_unix_p.h @@ -66,6 +66,28 @@ # include <ioLib.h> #endif +#ifndef QT_NO_NATIVE_POLL +# include <poll.h> +#else +struct pollfd { + int fd; + short events, revents; +}; + +typedef unsigned long int nfds_t; + +# define POLLIN 0x001 +# define POLLPRI 0x002 +# define POLLOUT 0x004 +# define POLLERR 0x008 +# define POLLHUP 0x010 +# define POLLNVAL 0x020 +# define POLLRDNORM 0x040 +# define POLLRDBAND 0x080 +# define POLLWRNORM 0x100 +# define POLLWRBAND 0x200 +#endif + struct sockaddr; #define EINTR_LOOP(var, cmd) \ @@ -303,6 +325,8 @@ static inline pid_t qt_safe_waitpid(pid_t pid, int *status, int options) timespec qt_gettime() Q_DECL_NOTHROW; void qt_nanosleep(timespec amount); +Q_CORE_EXPORT int qt_safe_poll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout_ts); + Q_CORE_EXPORT int qt_safe_select(int nfds, fd_set *fdread, fd_set *fdwrite, fd_set *fdexcept, const struct timespec *tv); |