summaryrefslogtreecommitdiffstats
path: root/include/qemu
diff options
context:
space:
mode:
authorAlex Bligh2013-08-21 17:02:43 +0200
committerStefan Hajnoczi2013-08-22 19:10:26 +0200
commit4e0c6529fcb5ccbed5eb2c4f094264eb447d49ea (patch)
tree0f89fb6942e9397892767290734b00ec00cfe9e8 /include/qemu
parentaio / timers: Consistent treatment of disabled clocks for deadlines (diff)
downloadqemu-4e0c6529fcb5ccbed5eb2c4f094264eb447d49ea.tar.gz
qemu-4e0c6529fcb5ccbed5eb2c4f094264eb447d49ea.tar.xz
qemu-4e0c6529fcb5ccbed5eb2c4f094264eb447d49ea.zip
aio / timers: add ppoll support with qemu_poll_ns
Add qemu_poll_ns which works like g_poll but takes a nanosecond timeout. Signed-off-by: Alex Bligh <alex@alex.org.uk> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'include/qemu')
-rw-r--r--include/qemu/timer.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/qemu/timer.h b/include/qemu/timer.h
index e0a51a1486..e4a6479137 100644
--- a/include/qemu/timer.h
+++ b/include/qemu/timer.h
@@ -63,6 +63,18 @@ int64_t qemu_clock_deadline_ns(QEMUClock *clock);
*/
int qemu_timeout_ns_to_ms(int64_t ns);
+/**
+ * qemu_poll_ns:
+ * @fds: Array of file descriptors
+ * @nfds: number of file descriptors
+ * @timeout: timeout in nanoseconds
+ *
+ * Perform a poll like g_poll but with a timeout in nanoseconds.
+ * See g_poll documentation for further details.
+ *
+ * Returns: number of fds ready
+ */
+int qemu_poll_ns(GPollFD *fds, guint nfds, int64_t timeout);
void qemu_clock_enable(QEMUClock *clock, bool enabled);
void qemu_clock_warp(QEMUClock *clock);