From 6a9ef1773bf874dea493ff3861782a1e577b67dd Mon Sep 17 00:00:00 2001 From: David Turner Date: Thu, 9 Sep 2010 22:54:36 +0200 Subject: upstream: move timer management code to qemu-timer.c --- cutils.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'cutils.c') 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 + -- cgit v1.1