From 9da4958b7853f36a137c80493bec932b79d85e84 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Mon, 25 Nov 2013 10:28:56 -0800 Subject: socket: limit vector count to IOV_MAX IOV_MAX is the maximum supported vector count on a given platform. Limit the count to IOV_MAX if higher. As we are performing non-blocking IO getting a smaller return value is handled naturally. Change-Id: I94ef67a03ed0e10da67a776af2b55506bf721611 BUG: 1034398 Signed-off-by: Anand Avati Reviewed-on: http://review.gluster.org/6354 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi --- libglusterfs/src/common-utils.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libglusterfs/src') diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h index 05e4d5b34..500d34237 100644 --- a/libglusterfs/src/common-utils.h +++ b/libglusterfs/src/common-utils.h @@ -27,6 +27,7 @@ #ifndef GF_BSD_HOST_OS #include #endif +#include void trap (void); @@ -258,6 +259,8 @@ union gf_sock_union { #define GF_HIDDEN_PATH ".glusterfs" +#define IOV_MIN(n) min(IOV_MAX,n) + static inline void iov_free (struct iovec *vector, int count) { -- cgit