summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--openbsd-compat/openbsd-compat.h10
2 files changed, 10 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 7342dcb77..03cc3f869 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1908,7 +1908,7 @@ AC_CHECK_DECLS([O_NONBLOCK], , ,
1908#endif 1908#endif
1909 ]) 1909 ])
1910 1910
1911AC_CHECK_DECLS([writev], , , [ 1911AC_CHECK_DECLS([readv, writev], , , [
1912#include <sys/types.h> 1912#include <sys/types.h>
1913#include <sys/uio.h> 1913#include <sys/uio.h>
1914#include <unistd.h> 1914#include <unistd.h>
diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h
index 8155a0dd7..b48fb9342 100644
--- a/openbsd-compat/openbsd-compat.h
+++ b/openbsd-compat/openbsd-compat.h
@@ -170,10 +170,18 @@ int BSDgetopt(int argc, char * const *argv, const char *opts);
170#include "openbsd-compat/getopt.h" 170#include "openbsd-compat/getopt.h"
171#endif 171#endif
172 172
173#if defined(HAVE_DECL_WRITEV) && HAVE_DECL_WRITEV == 0 173#if ((defined(HAVE_DECL_READV) && HAVE_DECL_READV == 0) || \
174 (defined(HAVE_DECL_WRITEV) && HAVE_DECL_WRITEV == 0))
174# include <sys/types.h> 175# include <sys/types.h>
175# include <sys/uio.h> 176# include <sys/uio.h>
177
178# if defined(HAVE_DECL_READV) && HAVE_DECL_READV == 0
179int readv(int, struct iovec *, int);
180# endif
181
182# if defined(HAVE_DECL_WRITEV) && HAVE_DECL_WRITEV == 0
176int writev(int, struct iovec *, int); 183int writev(int, struct iovec *, int);
184# endif
177#endif 185#endif
178 186
179/* Home grown routines */ 187/* Home grown routines */