Add prototype for readv if needed.

This commit is contained in:
Darren Tucker 2018-02-24 21:06:48 +11:00
parent 6c8c9a615b
commit 2eb4041493
2 changed files with 10 additions and 2 deletions

View File

@ -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>

View File

@ -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 */