summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Munro2022-08-13 11:24:42 +0000
committerThomas Munro2022-08-13 12:07:17 +0000
commit75357ab94034c6f2e65d146632691072756365c5 (patch)
tree1cd514e98e4a259aed0f1f373b5ad23145a482ac /src
parentabf46ad9c7b3748e9c36cf6020206064e69cea7e (diff)
Remove configure probe for sys/uio.h.
<sys/uio.h> is in SUSv2, and all targeted Unix system have it, so we might as well drop the probe (in fact we never really needed this one). It's where struct iovec is defined, and as a common extension, it's also where non-standard preadv() and pwritev() are declared on systems that have them. We should also be able to assume that IOV_MAX is defined on Unix. To spell out what our pg_iovec.h header does for the OSes in the build farm as of today: Windows: our own struct and functions Solaris, Cygwin: <sys/uio.h>'s struct, our own functions Every other Unix: <sys/uio.h>'s struct and functions Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CA%2BhUKG%2BL_3brvh%3D8e0BW_VfX9h7MtwgN%3DnFHP5o7X2oZucY9dg%40mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r--src/include/pg_config.h.in3
-rw-r--r--src/include/port/pg_iovec.h20
-rw-r--r--src/tools/msvc/Solution.pm1
3 files changed, 8 insertions, 16 deletions
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index fc5ad5fd658..ed6185343e2 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -538,9 +538,6 @@
/* Define to 1 if you have the <sys/ucred.h> header file. */
#undef HAVE_SYS_UCRED_H
-/* Define to 1 if you have the <sys/uio.h> header file. */
-#undef HAVE_SYS_UIO_H
-
/* Define to 1 if you have the <sys/un.h> header file. */
#undef HAVE_SYS_UN_H
diff --git a/src/include/port/pg_iovec.h b/src/include/port/pg_iovec.h
index f0a50c0e015..ecdddba7fcb 100644
--- a/src/include/port/pg_iovec.h
+++ b/src/include/port/pg_iovec.h
@@ -13,27 +13,23 @@
#ifndef PG_IOVEC_H
#define PG_IOVEC_H
-#include <limits.h>
+#ifndef WIN32
-#ifdef HAVE_SYS_UIO_H
+#include <limits.h>
#include <sys/uio.h>
-#endif
-/* If <sys/uio.h> is missing, define our own POSIX-compatible iovec struct. */
-#ifndef HAVE_SYS_UIO_H
+#else
+
+/* POSIX requires at least 16 as a maximum iovcnt. */
+#define IOV_MAX 16
+
+/* Define our own POSIX-compatible iovec struct. */
struct iovec
{
void *iov_base;
size_t iov_len;
};
-#endif
-/*
- * If <limits.h> didn't define IOV_MAX, define our own. POSIX requires at
- * least 16.
- */
-#ifndef IOV_MAX
-#define IOV_MAX 16
#endif
/* Define a reasonable maximum that is safe to use on the stack. */
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index cc82668457f..741998a1037 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -375,7 +375,6 @@ sub GenerateFiles
HAVE_SYS_STAT_H => 1,
HAVE_SYS_TYPES_H => 1,
HAVE_SYS_UCRED_H => undef,
- HAVE_SYS_UIO_H => undef,
HAVE_SYS_UN_H => undef,
HAVE_TERMIOS_H => undef,
HAVE_TYPEOF => undef,