diff options
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | openbsd-compat/openbsd-compat.h | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 7342dcb7..03cc3f86 100644 --- a/configure.ac +++ b/configure.ac @@ -1908,7 +1908,7 @@ AC_CHECK_DECLS([O_NONBLOCK], , , #endif ]) -AC_CHECK_DECLS([writev], , , [ +AC_CHECK_DECLS([readv, writev], , , [ #include <sys/types.h> #include <sys/uio.h> #include <unistd.h> diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h index 8155a0dd..b48fb934 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); #include "openbsd-compat/getopt.h" #endif -#if defined(HAVE_DECL_WRITEV) && HAVE_DECL_WRITEV == 0 +#if ((defined(HAVE_DECL_READV) && HAVE_DECL_READV == 0) || \ + (defined(HAVE_DECL_WRITEV) && HAVE_DECL_WRITEV == 0)) # include <sys/types.h> # include <sys/uio.h> + +# if defined(HAVE_DECL_READV) && HAVE_DECL_READV == 0 +int readv(int, struct iovec *, int); +# endif + +# if defined(HAVE_DECL_WRITEV) && HAVE_DECL_WRITEV == 0 int writev(int, struct iovec *, int); +# endif #endif /* Home grown routines */ |