From 016bc7513f0e758162d136476b8faa7e7832a60b Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 16 Feb 2012 23:30:13 -0600 Subject: Use standard IOV_MAX definition where applicable This is provided by on all platforms as long as _XOPEN_SOURCE is defined. On Linux, this is 1024, on Solaris, this is 16, and on any other platform, we now respect the value supported by the OS. Signed-off-by: Dan McGee --- server/red_channel.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'server/red_channel.h') diff --git a/server/red_channel.h b/server/red_channel.h index a360a302..ce534ca1 100644 --- a/server/red_channel.h +++ b/server/red_channel.h @@ -22,17 +22,22 @@ #ifndef _H_RED_CHANNEL #define _H_RED_CHANNEL -#include "red_common.h" #include +#include + +#include "red_common.h" #include "spice.h" #include "ring.h" #include "common/marshaller.h" #include "server/demarshallers.h" #define MAX_SEND_BUFS 1000 -#define MAX_SEND_VEC 100 #define CLIENT_ACK_WINDOW 20 +#ifndef IOV_MAX +#define IOV_MAX 1024 +#endif + #define MAX_HEADER_SIZE sizeof(SpiceDataHeader) /* Basic interface for channels, without using the RedChannel interface. @@ -109,7 +114,7 @@ typedef struct OutgoingHandlerInterface { typedef struct OutgoingHandler { OutgoingHandlerInterface *cb; void *opaque; - struct iovec vec_buf[MAX_SEND_VEC]; + struct iovec vec_buf[IOV_MAX]; int vec_size; struct iovec *vec; int pos; -- cgit