diff src/lib/compat.h @ 3623:085ebc6e341c HEAD

Use IOV_MAX instead of UIO_MAXIOV when available.
author Timo Sirainen <tss@iki.fi>
date Tue, 27 Sep 2005 22:49:59 +0300
parents 2f57438d9542
children 77135b9e26b5
line wrap: on
line diff
--- a/src/lib/compat.h	Tue Sep 27 00:00:08 2005 +0300
+++ b/src/lib/compat.h	Tue Sep 27 22:49:59 2005 +0300
@@ -93,6 +93,18 @@
 };
 #endif
 
+/* IOV_MAX should be in limits.h nowadays. Linux still (2005) requires
+   defining _XOPEN_SOURCE to get that value. UIO_MAXIOV works with it though,
+   so use it instead. 16 is the lowest acceptable value for all OSes. */
+#ifndef IOV_MAX
+#  include <sys/uio.h>
+#  ifdef UIO_MAXIOV
+#    define IOV_MAX UIO_MAXIOV
+#  else
+#    define IOV_MAX 16
+#  endif
+#endif
+
 #ifndef HAVE_WRITEV
 #  define writev my_writev
 struct iovec;