From 128aa58947637b0989330c2e6a22a824d39e2193 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Wed, 21 Sep 2011 12:36:48 +0200 Subject: move corking functions to osdep.c Signed-off-by: Paolo Bonzini --- osdep.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'osdep.c') diff --git a/osdep.c b/osdep.c index 70bad27..3e6bada 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) { -- cgit v1.1