Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Remove configure probe for sys/select.h.
authorThomas Munro <tmunro@postgresql.org>
Sat, 13 Aug 2022 11:33:34 +0000 (23:33 +1200)
committerThomas Munro <tmunro@postgresql.org>
Sat, 13 Aug 2022 12:09:47 +0000 (00:09 +1200)
<sys/select.h> is in SUSv3 and every targeted Unix system has it.
Provide an empty header in src/include/port/win32 so that we can
include it unguarded even on Windows.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CA%2BhUKG%2BL_3brvh%3D8e0BW_VfX9h7MtwgN%3DnFHP5o7X2oZucY9dg%40mail.gmail.com

20 files changed:
configure
configure.ac
doc/src/sgml/libpq.sgml
src/backend/libpq/auth.c
src/backend/postmaster/postmaster.c
src/backend/tcop/postgres.c
src/bin/pg_basebackup/pg_basebackup.c
src/bin/pg_basebackup/pg_recvlogical.c
src/bin/pg_basebackup/receivelog.c
src/bin/pg_dump/parallel.c
src/bin/pgbench/pgbench.c
src/fe_utils/parallel_slot.c
src/include/pg_config.h.in
src/include/port/win32/sys/select.h [new file with mode: 0644]
src/interfaces/libpq/fe-misc.c
src/port/pgsleep.c
src/test/examples/testlibpq2.c
src/test/isolation/isolationtester.c
src/test/modules/libpq_pipeline/libpq_pipeline.c
src/tools/msvc/Solution.pm

index b0bc818af8c15bfc4e3885f3db30b4626e639058..804162e8731814228bde4c889e3230f353e970bd 100755 (executable)
--- a/configure
+++ b/configure
@@ -13874,7 +13874,7 @@ $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
 fi
 
 
-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 termios.h ucred.h
+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/sem.h sys/shm.h sys/signalfd.h sys/sockio.h sys/ucred.h termios.h ucred.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
index 666ad7dbcba8873bd137911bb98afb57e5829e84..a9474fd8f33abbaf680ec5bb7ba69fe19443f3ce 100644 (file)
@@ -1461,7 +1461,6 @@ AC_CHECK_HEADERS(m4_normalize([
    sys/prctl.h
    sys/procctl.h
    sys/resource.h
-   sys/select.h
    sys/sem.h
    sys/shm.h
    sys/signalfd.h
index 74456aa69d73d47bfae377e7fb51fb7595bd708f..fab602b37e74aef2e25a7ae3511518cbe7a31799 100644 (file)
@@ -9211,11 +9211,9 @@ main(int argc, char **argv)
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
+#include <sys/select.h>
 #include <sys/time.h>
 #include <sys/types.h>
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
 
 #include "libpq-fe.h"
 
index 2d9ab7edceb421e5d2e408678cceb51b5bf8e620..41d60e06d0c324ebfc74dfd1431ccf05fd78aadd 100644 (file)
 #include "postgres.h"
 
 #include <sys/param.h>
+#include <sys/select.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <pwd.h>
 #include <unistd.h>
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
 
 #include "commands/user.h"
 #include "common/ip.h"
index 81cb585891b9e02e2b103b7ff25be87255fb09c7..227bd9891ec208fe054354146aac19d2e88f702b 100644 (file)
@@ -70,6 +70,7 @@
 #include <time.h>
 #include <sys/wait.h>
 #include <ctype.h>
+#include <sys/select.h>
 #include <sys/stat.h>
 #include <sys/socket.h>
 #include <fcntl.h>
 #include <netdb.h>
 #include <limits.h>
 
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
-
 #ifdef USE_BONJOUR
 #include <dns_sd.h>
 #endif
index 11e802eba98de9b17b9137399b231080712c9cd2..671edcb3c7a878da4a74b982ee10b7304c98712c 100644 (file)
 #include <limits.h>
 #include <signal.h>
 #include <unistd.h>
-#include <sys/socket.h>
-#ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
-#endif
+#include <sys/socket.h>
 #ifdef HAVE_SYS_RESOURCE_H
 #include <sys/time.h>
 #include <sys/resource.h>
index 49fcabbd2c6e6b08e6218900e94b2080f04cb708..9ce30d43a417254728e7ed3d9507f4f0c16cf967 100644 (file)
 #include <unistd.h>
 #include <dirent.h>
 #include <limits.h>
+#include <sys/select.h>
 #include <sys/stat.h>
 #include <sys/wait.h>
 #include <signal.h>
 #include <time.h>
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
 #ifdef HAVE_LIBZ
 #include <zlib.h>
 #endif
index b59ff23f6125e732b57a9dc8015a70d3f2ec23af..2a4c8b130a0fe06b81787da37f2a23ddad9bdaa6 100644 (file)
 
 #include <dirent.h>
 #include <limits.h>
+#include <sys/select.h>
 #include <sys/stat.h>
 #include <unistd.h>
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
 
 #include "access/xlog_internal.h"
 #include "common/fe_memutils.h"
index ad866a76024d44fc8b4721ded555aede47e53264..976d1e73b1fcbd6266f3e0cc81ef08d9c8bcb119 100644 (file)
 
 #include "postgres_fe.h"
 
+#include <sys/select.h>
 #include <sys/stat.h>
 #include <unistd.h>
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
 
 #include "access/xlog_internal.h"
 #include "common/file_utils.h"
index c9f6b86bb05f5d8716cf1953c0ed83aaac45e4b7..c8a70d9bc186841d1cfbfd67c3548569d3a940ad 100644 (file)
 #include "postgres_fe.h"
 
 #ifndef WIN32
+#include <sys/select.h>
 #include <sys/wait.h>
 #include <signal.h>
 #include <unistd.h>
 #include <fcntl.h>
 #endif
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
 
 #include "fe_utils/string_utils.h"
 #include "parallel.h"
index 0778656794a064e9b760dbf5fd7f9426ab55d456..45606e944da464557d1ca73207c1e9e4b16571ee 100644 (file)
 #endif
 #else                          /* no ppoll(), so use select() */
 #define POLL_USING_SELECT
-#ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
-#endif
 
 #include "common/int.h"
 #include "common/logging.h"
index 684327885d3565b9d5a2820564e351d2d8eba7b9..8bce8ca366377741aa3b58ade77fb7bd404f6f1e 100644 (file)
@@ -18,9 +18,7 @@
 
 #include "postgres_fe.h"
 
-#ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
-#endif
 
 #include "common/logging.h"
 #include "fe_utils/cancel.h"
index b6c73ccd71939ad73553eedfe01a345167340389..f666b4173b3014e1e474ba0e23066060d329f882 100644 (file)
 /* Define to 1 if you have the <sys/resource.h> header file. */
 #undef HAVE_SYS_RESOURCE_H
 
-/* Define to 1 if you have the <sys/select.h> header file. */
-#undef HAVE_SYS_SELECT_H
-
 /* Define to 1 if you have the <sys/sem.h> header file. */
 #undef HAVE_SYS_SEM_H
 
diff --git a/src/include/port/win32/sys/select.h b/src/include/port/win32/sys/select.h
new file mode 100644 (file)
index 0000000..f8a877a
--- /dev/null
@@ -0,0 +1,3 @@
+/*
+ * src/include/port/win32/sys/select.h
+ */
index d76bb3957ae87a78d8cc0e7d452739d538bcadaf..795500c593545c7ed572b5a139044defef32cd3e 100644 (file)
 #include "win32.h"
 #else
 #include <unistd.h>
+#include <sys/select.h>
 #include <sys/time.h>
 #endif
 
 #ifdef HAVE_POLL_H
 #include <poll.h>
 #endif
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
 
 #include "libpq-fe.h"
 #include "libpq-int.h"
index a84e6ccb38baeb07fcbc6ba836d9470991575d23..03f0fac07bd0a62651112e903febe5aea730e7d0 100644 (file)
 #include "c.h"
 
 #include <unistd.h>
-#include <sys/time.h>
-#ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
-#endif
+#include <sys/time.h>
 
 /*
  * In a Windows backend, we don't use this implementation, but rather
index 6337b315a42996d2610fe4204ba39f4cfc136eab..05ce8c3f138c40a391d6ab1bcd08a1628f3e03aa 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
+#include <sys/select.h>
 #include <sys/time.h>
 #include <sys/types.h>
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
 
 #include "libpq-fe.h"
 
index 095db8f35c12a1402c591a7e1b04a4b384a1502d..0a66235153aab85821c3922a2a614c9439b65f9f 100644 (file)
@@ -7,10 +7,8 @@
 
 #include "postgres_fe.h"
 
-#include <sys/time.h>
-#ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
-#endif
+#include <sys/time.h>
 
 #include "datatype/timestamp.h"
 #include "isolationtester.h"
index dc17898a617f6c26d74386a2b790746e00cde6ea..0407c4a8c004467a22b0e85ab95b14114eb71816 100644 (file)
 
 #include "postgres_fe.h"
 
-#include <sys/time.h>
-#ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
-#endif
+#include <sys/time.h>
 
 #include "catalog/pg_type_d.h"
 #include "common/fe_memutils.h"
index ed437ce084d200f516d5e407f0103d054200b3d7..b552f439cc74d769d67cf3bd76e5ef51f210ddac 100644 (file)
@@ -366,7 +366,6 @@ sub GenerateFiles
        HAVE_SYS_PRCTL_H                         => undef,
        HAVE_SYS_PROCCTL_H                       => undef,
        HAVE_SYS_RESOURCE_H                      => undef,
-       HAVE_SYS_SELECT_H                        => undef,
        HAVE_SYS_SEM_H                           => undef,
        HAVE_SYS_SHM_H                           => undef,
        HAVE_SYS_SIGNALFD_H                      => undef,