aboutsummaryrefslogtreecommitdiffstats
path: root/cutils.c
diff options
context:
space:
mode:
authorDavid Turner <digit@android.com>2010-09-09 22:54:36 +0200
committerDavid 'Digit' Turner <digit@android.com>2010-09-13 00:30:34 -0700
commit6a9ef1773bf874dea493ff3861782a1e577b67dd (patch)
tree18cb2addd19195710b8860077ed9bfbef8ad44a5 /cutils.c
parent0c0b2b4e96b030854987b16a779e30a3741d3b0d (diff)
downloadexternal_qemu-6a9ef1773bf874dea493ff3861782a1e577b67dd.zip
external_qemu-6a9ef1773bf874dea493ff3861782a1e577b67dd.tar.gz
external_qemu-6a9ef1773bf874dea493ff3861782a1e577b67dd.tar.bz2
upstream: move timer management code to qemu-timer.c
Diffstat (limited to 'cutils.c')
-rw-r--r--cutils.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/cutils.c b/cutils.c
index 2365e68..036ae3c 100644
--- a/cutils.c
+++ b/cutils.c
@@ -233,3 +233,21 @@ void qemu_iovec_from_buffer(QEMUIOVector *qiov, const void *buf, size_t count)
count -= copy;
}
}
+
+#ifndef _WIN32
+/* Sets a specific flag */
+int fcntl_setfl(int fd, int flag)
+{
+ int flags;
+
+ flags = fcntl(fd, F_GETFL);
+ if (flags == -1)
+ return -errno;
+
+ if (fcntl(fd, F_SETFL, flags | flag) == -1)
+ return -errno;
+
+ return 0;
+}
+#endif
+