diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2010-03-10 11:38:55 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-03-17 11:16:15 -0500 |
commit | db1a49726c3c6cbe9cbca5b118e80c0fec65e8dd (patch) | |
tree | dc4f42c9d7476e43f8a0c5547e31c193b71fbe96 /cutils.c | |
parent | d6f4ade214a9f74dca9495b83a24ff9c113e4f9a (diff) |
split out qemu-timer.c
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'cutils.c')
-rw-r--r-- | cutils.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -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 + |