aboutsummaryrefslogtreecommitdiff
path: root/osdep.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2011-09-21 12:36:48 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2011-12-22 11:53:58 +0100
commit128aa58947637b0989330c2e6a22a824d39e2193 (patch)
treea0e66b9499084abf822721d095094a904b3b4b83 /osdep.c
parent3777b09fd75ba746cf65d0ba30d73a5dd7a02d65 (diff)
move corking functions to osdep.c
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'osdep.c')
-rw-r--r--osdep.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/osdep.c b/osdep.c
index 70bad27f6e..3e6badac1e 100644
--- a/osdep.c
+++ b/osdep.c
@@ -48,6 +48,15 @@ extern int madvise(caddr_t, size_t, int);
#include "trace.h"
#include "qemu_socket.h"
+int socket_set_cork(int fd, int v)
+{
+#if defined(SOL_TCP) && defined(TCP_CORK)
+ return setsockopt(fd, SOL_TCP, TCP_CORK, &v, sizeof(v));
+#else
+ return 0;
+#endif
+}
+
int qemu_madvise(void *addr, size_t len, int advice)
{
if (advice == QEMU_MADV_INVALID) {