Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 75357ab

Browse files
committed
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
1 parent abf46ad commit 75357ab

File tree

5 files changed

+9
-18
lines changed

5 files changed

+9
-18
lines changed

configure

+1-1
Original file line numberDiff line numberDiff line change
@@ -13874,7 +13874,7 @@ $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
1387413874
fi
1387513875

1387613876

13877-
for ac_header in atomic.h copyfile.h execinfo.h getopt.h ifaddrs.h langinfo.h mbarrier.h net/if.h netinet/tcp.h sys/epoll.h sys/event.h sys/ipc.h sys/personality.h sys/prctl.h sys/procctl.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/signalfd.h sys/sockio.h sys/ucred.h sys/uio.h sys/un.h termios.h ucred.h
13877+
for ac_header in atomic.h copyfile.h execinfo.h getopt.h ifaddrs.h langinfo.h mbarrier.h net/if.h netinet/tcp.h sys/epoll.h sys/event.h sys/ipc.h sys/personality.h sys/prctl.h sys/procctl.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/signalfd.h sys/sockio.h sys/ucred.h sys/un.h termios.h ucred.h
1387813878
do :
1387913879
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
1388013880
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"

configure.ac

-1
Original file line numberDiff line numberDiff line change
@@ -1467,7 +1467,6 @@ AC_CHECK_HEADERS(m4_normalize([
14671467
sys/signalfd.h
14681468
sys/sockio.h
14691469
sys/ucred.h
1470-
sys/uio.h
14711470
sys/un.h
14721471
termios.h
14731472
ucred.h

src/include/pg_config.h.in

-3
Original file line numberDiff line numberDiff line change
@@ -538,9 +538,6 @@
538538
/* Define to 1 if you have the <sys/ucred.h> header file. */
539539
#undef HAVE_SYS_UCRED_H
540540

541-
/* Define to 1 if you have the <sys/uio.h> header file. */
542-
#undef HAVE_SYS_UIO_H
543-
544541
/* Define to 1 if you have the <sys/un.h> header file. */
545542
#undef HAVE_SYS_UN_H
546543

src/include/port/pg_iovec.h

+8-12
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,23 @@
1313
#ifndef PG_IOVEC_H
1414
#define PG_IOVEC_H
1515

16-
#include <limits.h>
16+
#ifndef WIN32
1717

18-
#ifdef HAVE_SYS_UIO_H
18+
#include <limits.h>
1919
#include <sys/uio.h>
20-
#endif
2120

22-
/* If <sys/uio.h> is missing, define our own POSIX-compatible iovec struct. */
23-
#ifndef HAVE_SYS_UIO_H
21+
#else
22+
23+
/* POSIX requires at least 16 as a maximum iovcnt. */
24+
#define IOV_MAX 16
25+
26+
/* Define our own POSIX-compatible iovec struct. */
2427
struct iovec
2528
{
2629
void *iov_base;
2730
size_t iov_len;
2831
};
29-
#endif
3032

31-
/*
32-
* If <limits.h> didn't define IOV_MAX, define our own. POSIX requires at
33-
* least 16.
34-
*/
35-
#ifndef IOV_MAX
36-
#define IOV_MAX 16
3733
#endif
3834

3935
/* Define a reasonable maximum that is safe to use on the stack. */

src/tools/msvc/Solution.pm

-1
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,6 @@ sub GenerateFiles
375375
HAVE_SYS_STAT_H => 1,
376376
HAVE_SYS_TYPES_H => 1,
377377
HAVE_SYS_UCRED_H => undef,
378-
HAVE_SYS_UIO_H => undef,
379378
HAVE_SYS_UN_H => undef,
380379
HAVE_TERMIOS_H => undef,
381380
HAVE_TYPEOF => undef,

0 commit comments

Comments
 (0)