diff options
Diffstat (limited to 'src/corelib/kernel/qcore_unix_p.h')
-rw-r--r-- | src/corelib/kernel/qcore_unix_p.h | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/src/corelib/kernel/qcore_unix_p.h b/src/corelib/kernel/qcore_unix_p.h index d5434888d0..fcc65589a0 100644 --- a/src/corelib/kernel/qcore_unix_p.h +++ b/src/corelib/kernel/qcore_unix_p.h @@ -66,26 +66,10 @@ # include <ioLib.h> #endif -#ifndef QT_NO_NATIVE_POLL -# include <poll.h> +#ifdef QT_NO_NATIVE_POLL +# include "qpoll_p.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 +# include <poll.h> #endif struct sockaddr; @@ -143,6 +127,14 @@ inline timespec operator*(const timespec &t1, int mul) tmp.tv_nsec = t1.tv_nsec * mul; return normalizedTimespec(tmp); } +inline timeval timespecToTimeval(const timespec &ts) +{ + timeval tv; + tv.tv_sec = ts.tv_sec; + tv.tv_usec = ts.tv_nsec / 1000; + return tv; +} + inline void qt_ignore_sigpipe() { |