diff options
Diffstat (limited to 'src/corelib/kernel/qcore_unix_p.h')
-rw-r--r-- | src/corelib/kernel/qcore_unix_p.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/corelib/kernel/qcore_unix_p.h b/src/corelib/kernel/qcore_unix_p.h index f80dcb5a50..fcc65589a0 100644 --- a/src/corelib/kernel/qcore_unix_p.h +++ b/src/corelib/kernel/qcore_unix_p.h @@ -66,6 +66,12 @@ # include <ioLib.h> #endif +#ifdef QT_NO_NATIVE_POLL +# include "qpoll_p.h" +#else +# include <poll.h> +#endif + struct sockaddr; #define EINTR_LOOP(var, cmd) \ @@ -121,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() { @@ -303,17 +317,13 @@ 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); int qt_select_msecs(int nfds, fd_set *fdread, fd_set *fdwrite, int timeout); -#ifdef Q_OS_BLACKBERRY -class QSocketNotifier; -Q_CORE_EXPORT int bb_select(QList<QSocketNotifier *> socketNotifiers, int nfds, fd_set *fdread, - fd_set *fdwrite, int timeout); -#endif // Q_OS_BLACKBERRY - // according to X/OPEN we have to define semun ourselves // we use prefix as on some systems sem.h will have it struct semid_ds; |