summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qcore_unix.cpp
diff options
context:
space:
mode:
authorLouai Al-Khanji <louai.al-khanji@theqtcompany.com>2015-12-02 18:48:46 -0800
committerLouai Al-Khanji <louai.al-khanji@theqtcompany.com>2016-02-03 10:25:21 +0000
commit24642df23ca33436bb9deb02ee5a85287b019af9 (patch)
tree0840297d7d0a47bc06e898c7bd778ce66181cb2d /src/corelib/kernel/qcore_unix.cpp
parenta0f9ee5dca8e5482fb43583c6a6bdf731e3bcc5a (diff)
QProcess: Use poll instead of select on Unix platforms
Change-Id: I3386ef228ce95209f6f221e18293d991b24a7b2e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qcore_unix.cpp')
-rw-r--r--src/corelib/kernel/qcore_unix.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/corelib/kernel/qcore_unix.cpp b/src/corelib/kernel/qcore_unix.cpp
index 23b98430bc..c82754db82 100644
--- a/src/corelib/kernel/qcore_unix.cpp
+++ b/src/corelib/kernel/qcore_unix.cpp
@@ -184,4 +184,18 @@ int qt_safe_poll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout
}
}
+int qt_poll_msecs(pollfd *fds, nfds_t nfds, int timeout)
+{
+ timespec ts, *pts = Q_NULLPTR;
+
+ if (timeout >= 0) {
+ ts.tv_sec = timeout / 1000;
+ ts.tv_nsec = (timeout % 1000) * 1000 * 1000;
+
+ pts = &ts;
+ }
+
+ return qt_safe_poll(fds, nfds, pts);
+}
+
QT_END_NAMESPACE