Skip to content

Commit 7e50b4e

Browse files
committed
Remove configure probe for sys/select.h.
<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
1 parent 077bf2f commit 7e50b4e

File tree

20 files changed

+17
-50
lines changed

20 files changed

+17
-50
lines changed

configure

Lines changed: 1 addition & 1 deletion
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 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/sem.h sys/shm.h sys/signalfd.h sys/sockio.h sys/ucred.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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1461,7 +1461,6 @@ AC_CHECK_HEADERS(m4_normalize([
14611461
sys/prctl.h
14621462
sys/procctl.h
14631463
sys/resource.h
1464-
sys/select.h
14651464
sys/sem.h
14661465
sys/shm.h
14671466
sys/signalfd.h

doc/src/sgml/libpq.sgml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9211,11 +9211,9 @@ main(int argc, char **argv)
92119211
#include <stdlib.h>
92129212
#include <string.h>
92139213
#include <errno.h>
9214+
#include <sys/select.h>
92149215
#include <sys/time.h>
92159216
#include <sys/types.h>
9216-
#ifdef HAVE_SYS_SELECT_H
9217-
#include <sys/select.h>
9218-
#endif
92199217

92209218
#include "libpq-fe.h"
92219219

src/backend/libpq/auth.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@
1616
#include "postgres.h"
1717

1818
#include <sys/param.h>
19+
#include <sys/select.h>
1920
#include <sys/socket.h>
2021
#include <netinet/in.h>
2122
#include <pwd.h>
2223
#include <unistd.h>
23-
#ifdef HAVE_SYS_SELECT_H
24-
#include <sys/select.h>
25-
#endif
2624

2725
#include "commands/user.h"
2826
#include "common/ip.h"

src/backend/postmaster/postmaster.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,14 @@
7070
#include <time.h>
7171
#include <sys/wait.h>
7272
#include <ctype.h>
73+
#include <sys/select.h>
7374
#include <sys/stat.h>
7475
#include <sys/socket.h>
7576
#include <fcntl.h>
7677
#include <sys/param.h>
7778
#include <netdb.h>
7879
#include <limits.h>
7980

80-
#ifdef HAVE_SYS_SELECT_H
81-
#include <sys/select.h>
82-
#endif
83-
8481
#ifdef USE_BONJOUR
8582
#include <dns_sd.h>
8683
#endif

src/backend/tcop/postgres.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@
2323
#include <limits.h>
2424
#include <signal.h>
2525
#include <unistd.h>
26-
#include <sys/socket.h>
27-
#ifdef HAVE_SYS_SELECT_H
2826
#include <sys/select.h>
29-
#endif
27+
#include <sys/socket.h>
3028
#ifdef HAVE_SYS_RESOURCE_H
3129
#include <sys/time.h>
3230
#include <sys/resource.h>

src/bin/pg_basebackup/pg_basebackup.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@
1616
#include <unistd.h>
1717
#include <dirent.h>
1818
#include <limits.h>
19+
#include <sys/select.h>
1920
#include <sys/stat.h>
2021
#include <sys/wait.h>
2122
#include <signal.h>
2223
#include <time.h>
23-
#ifdef HAVE_SYS_SELECT_H
24-
#include <sys/select.h>
25-
#endif
2624
#ifdef HAVE_LIBZ
2725
#include <zlib.h>
2826
#endif

src/bin/pg_basebackup/pg_recvlogical.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@
1414

1515
#include <dirent.h>
1616
#include <limits.h>
17+
#include <sys/select.h>
1718
#include <sys/stat.h>
1819
#include <unistd.h>
19-
#ifdef HAVE_SYS_SELECT_H
20-
#include <sys/select.h>
21-
#endif
2220

2321
#include "access/xlog_internal.h"
2422
#include "common/fe_memutils.h"

src/bin/pg_basebackup/receivelog.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@
1414

1515
#include "postgres_fe.h"
1616

17+
#include <sys/select.h>
1718
#include <sys/stat.h>
1819
#include <unistd.h>
19-
#ifdef HAVE_SYS_SELECT_H
20-
#include <sys/select.h>
21-
#endif
2220

2321
#include "access/xlog_internal.h"
2422
#include "common/file_utils.h"

src/bin/pg_dump/parallel.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,12 @@
5353
#include "postgres_fe.h"
5454

5555
#ifndef WIN32
56+
#include <sys/select.h>
5657
#include <sys/wait.h>
5758
#include <signal.h>
5859
#include <unistd.h>
5960
#include <fcntl.h>
6061
#endif
61-
#ifdef HAVE_SYS_SELECT_H
62-
#include <sys/select.h>
63-
#endif
6462

6563
#include "fe_utils/string_utils.h"
6664
#include "parallel.h"

src/bin/pgbench/pgbench.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@
5252
#endif
5353
#else /* no ppoll(), so use select() */
5454
#define POLL_USING_SELECT
55-
#ifdef HAVE_SYS_SELECT_H
5655
#include <sys/select.h>
5756
#endif
58-
#endif
5957

6058
#include "common/int.h"
6159
#include "common/logging.h"

src/fe_utils/parallel_slot.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818

1919
#include "postgres_fe.h"
2020

21-
#ifdef HAVE_SYS_SELECT_H
2221
#include <sys/select.h>
23-
#endif
2422

2523
#include "common/logging.h"
2624
#include "fe_utils/cancel.h"

src/include/pg_config.h.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -511,9 +511,6 @@
511511
/* Define to 1 if you have the <sys/resource.h> header file. */
512512
#undef HAVE_SYS_RESOURCE_H
513513

514-
/* Define to 1 if you have the <sys/select.h> header file. */
515-
#undef HAVE_SYS_SELECT_H
516-
517514
/* Define to 1 if you have the <sys/sem.h> header file. */
518515
#undef HAVE_SYS_SEM_H
519516

src/include/port/win32/sys/select.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/*
2+
* src/include/port/win32/sys/select.h
3+
*/

src/interfaces/libpq/fe-misc.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,13 @@
3737
#include "win32.h"
3838
#else
3939
#include <unistd.h>
40+
#include <sys/select.h>
4041
#include <sys/time.h>
4142
#endif
4243

4344
#ifdef HAVE_POLL_H
4445
#include <poll.h>
4546
#endif
46-
#ifdef HAVE_SYS_SELECT_H
47-
#include <sys/select.h>
48-
#endif
4947

5048
#include "libpq-fe.h"
5149
#include "libpq-int.h"

src/port/pgsleep.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@
1313
#include "c.h"
1414

1515
#include <unistd.h>
16-
#include <sys/time.h>
17-
#ifdef HAVE_SYS_SELECT_H
1816
#include <sys/select.h>
19-
#endif
17+
#include <sys/time.h>
2018

2119
/*
2220
* In a Windows backend, we don't use this implementation, but rather

src/test/examples/testlibpq2.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,9 @@
3232
#include <stdlib.h>
3333
#include <string.h>
3434
#include <errno.h>
35+
#include <sys/select.h>
3536
#include <sys/time.h>
3637
#include <sys/types.h>
37-
#ifdef HAVE_SYS_SELECT_H
38-
#include <sys/select.h>
39-
#endif
4038

4139
#include "libpq-fe.h"
4240

src/test/isolation/isolationtester.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77

88
#include "postgres_fe.h"
99

10-
#include <sys/time.h>
11-
#ifdef HAVE_SYS_SELECT_H
1210
#include <sys/select.h>
13-
#endif
11+
#include <sys/time.h>
1412

1513
#include "datatype/timestamp.h"
1614
#include "isolationtester.h"

src/test/modules/libpq_pipeline/libpq_pipeline.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@
1515

1616
#include "postgres_fe.h"
1717

18-
#include <sys/time.h>
19-
#ifdef HAVE_SYS_SELECT_H
2018
#include <sys/select.h>
21-
#endif
19+
#include <sys/time.h>
2220

2321
#include "catalog/pg_type_d.h"
2422
#include "common/fe_memutils.h"

src/tools/msvc/Solution.pm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,6 @@ sub GenerateFiles
366366
HAVE_SYS_PRCTL_H => undef,
367367
HAVE_SYS_PROCCTL_H => undef,
368368
HAVE_SYS_RESOURCE_H => undef,
369-
HAVE_SYS_SELECT_H => undef,
370369
HAVE_SYS_SEM_H => undef,
371370
HAVE_SYS_SHM_H => undef,
372371
HAVE_SYS_SIGNALFD_H => undef,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy