summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/c-library.m414
-rwxr-xr-xconfigure17
-rw-r--r--configure.ac2
-rw-r--r--src/include/c.h4
-rw-r--r--src/include/libpq/pqcomm.h4
-rw-r--r--src/include/pg_config.h.in6
-rw-r--r--src/include/port.h3
-rw-r--r--src/include/port/win32.h11
-rw-r--r--src/include/port/win32/sys/un.h17
-rw-r--r--src/port/getpeereid.c4
-rw-r--r--src/tools/msvc/Solution.pm2
11 files changed, 23 insertions, 61 deletions
diff --git a/config/c-library.m4 b/config/c-library.m4
index 35fdc63afe..76552ac6ed 100644
--- a/config/c-library.m4
+++ b/config/c-library.m4
@@ -76,20 +76,6 @@ AC_DEFUN([PGAC_UNION_SEMUN],
#endif])])# PGAC_UNION_SEMUN
-# PGAC_STRUCT_SOCKADDR_UN
-# -----------------------
-# If `struct sockaddr_un' exists, define HAVE_STRUCT_SOCKADDR_UN.
-# If it is missing then one could define it.
-# (Requires test for <sys/un.h>!)
-AC_DEFUN([PGAC_STRUCT_SOCKADDR_UN],
-[AC_CHECK_TYPES([struct sockaddr_un], [], [],
-[#include <sys/types.h>
-#ifdef HAVE_SYS_UN_H
-#include <sys/un.h>
-#endif
-])])# PGAC_STRUCT_SOCKADDR_UN
-
-
# PGAC_STRUCT_SOCKADDR_STORAGE
# ----------------------------
# If `struct sockaddr_storage' exists, define HAVE_STRUCT_SOCKADDR_STORAGE.
diff --git a/configure b/configure
index ef5334a12d..b0bc818af8 100755
--- 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 sys/un.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/select.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"
@@ -15119,21 +15119,6 @@ _ACEOF
fi
-ac_fn_c_check_type "$LINENO" "struct sockaddr_un" "ac_cv_type_struct_sockaddr_un" "#include <sys/types.h>
-#ifdef HAVE_SYS_UN_H
-#include <sys/un.h>
-#endif
-
-"
-if test "x$ac_cv_type_struct_sockaddr_un" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_SOCKADDR_UN 1
-_ACEOF
-
-
-fi
-
ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "#include <sys/types.h>
#include <sys/socket.h>
diff --git a/configure.ac b/configure.ac
index c1b75e0f34..666ad7dbcb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1467,7 +1467,6 @@ AC_CHECK_HEADERS(m4_normalize([
sys/signalfd.h
sys/sockio.h
sys/ucred.h
- sys/un.h
termios.h
ucred.h
]))
@@ -1625,7 +1624,6 @@ PGAC_C_COMPUTED_GOTO
PGAC_STRUCT_TIMEZONE
PGAC_UNION_SEMUN
AC_CHECK_TYPES(socklen_t, [], [], [#include <sys/socket.h>])
-PGAC_STRUCT_SOCKADDR_UN
PGAC_STRUCT_SOCKADDR_STORAGE
PGAC_STRUCT_SOCKADDR_STORAGE_MEMBERS
PGAC_STRUCT_ADDRINFO
diff --git a/src/include/c.h b/src/include/c.h
index de9ec04d49..65e91a6b89 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -1113,10 +1113,6 @@ extern void ExceptionalCondition(const char *conditionName,
* ----------------------------------------------------------------
*/
-#ifdef HAVE_STRUCT_SOCKADDR_UN
-#define HAVE_UNIX_SOCKETS 1
-#endif
-
/*
* Invert the sign of a qsort-style comparison result, ie, exchange negative
* and positive integer values, being careful not to get the wrong answer
diff --git a/src/include/libpq/pqcomm.h b/src/include/libpq/pqcomm.h
index b418283d5f..3bcc06b2d6 100644
--- a/src/include/libpq/pqcomm.h
+++ b/src/include/libpq/pqcomm.h
@@ -17,10 +17,8 @@
#define PQCOMM_H
#include <sys/socket.h>
-#include <netdb.h>
-#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
-#endif
+#include <netdb.h>
#include <netinet/in.h>
#ifdef HAVE_STRUCT_SOCKADDR_STORAGE
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index ed6185343e..b6c73ccd71 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -478,9 +478,6 @@
/* Define to 1 if `__ss_len' is a member of `struct sockaddr_storage'. */
#undef HAVE_STRUCT_SOCKADDR_STORAGE___SS_LEN
-/* Define to 1 if the system has the type `struct sockaddr_un'. */
-#undef HAVE_STRUCT_SOCKADDR_UN
-
/* Define to 1 if `tm_zone' is a member of `struct tm'. */
#undef HAVE_STRUCT_TM_TM_ZONE
@@ -538,9 +535,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/un.h> header file. */
-#undef HAVE_SYS_UN_H
-
/* Define to 1 if you have the <termios.h> header file. */
#undef HAVE_TERMIOS_H
diff --git a/src/include/port.h b/src/include/port.h
index cec41eae71..80dcfb7dfe 100644
--- a/src/include/port.h
+++ b/src/include/port.h
@@ -503,4 +503,7 @@ extern bool wait_result_is_any_signal(int exit_status, bool include_command_not_
#define HAVE_SYMLINK 1
#endif
+/* Interfaces that we assume that all systems have. */
+#define HAVE_UNIX_SOCKETS 1
+
#endif /* PG_PORT_H */
diff --git a/src/include/port/win32.h b/src/include/port/win32.h
index 5f3b17a500..67755aadc4 100644
--- a/src/include/port/win32.h
+++ b/src/include/port/win32.h
@@ -55,14 +55,3 @@
#ifdef _MSC_VER
#define PGDLLEXPORT __declspec (dllexport)
#endif
-
-/*
- * Windows headers don't define this structure, but you can define it yourself
- * to use the functionality.
- */
-struct sockaddr_un
-{
- unsigned short sun_family;
- char sun_path[108];
-};
-#define HAVE_STRUCT_SOCKADDR_UN 1
diff --git a/src/include/port/win32/sys/un.h b/src/include/port/win32/sys/un.h
new file mode 100644
index 0000000000..4fc13a23fd
--- /dev/null
+++ b/src/include/port/win32/sys/un.h
@@ -0,0 +1,17 @@
+/*
+ * src/include/port/win32/sys/un.h
+ */
+#ifndef WIN32_SYS_UN_H
+#define WIN32_SYS_UN_H
+
+/*
+ * Windows defines this structure in <afunix.h>, but not all tool chains have
+ * the header yet, so we define it here for now.
+ */
+struct sockaddr_un
+{
+ unsigned short sun_family;
+ char sun_path[108];
+};
+
+#endif
diff --git a/src/port/getpeereid.c b/src/port/getpeereid.c
index 56ae141040..0bb07782ba 100644
--- a/src/port/getpeereid.c
+++ b/src/port/getpeereid.c
@@ -16,10 +16,8 @@
#include <sys/param.h>
#include <sys/socket.h>
-#include <unistd.h>
-#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
-#endif
+#include <unistd.h>
#ifdef HAVE_UCRED_H
#include <ucred.h>
#endif
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 741998a103..ed437ce084 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -355,7 +355,6 @@ sub GenerateFiles
HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN => undef,
HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY => undef,
HAVE_STRUCT_SOCKADDR_STORAGE___SS_LEN => undef,
- HAVE_STRUCT_SOCKADDR_UN => undef,
HAVE_STRUCT_TM_TM_ZONE => undef,
HAVE_SYNC_FILE_RANGE => undef,
HAVE_SYNCFS => undef,
@@ -375,7 +374,6 @@ sub GenerateFiles
HAVE_SYS_STAT_H => 1,
HAVE_SYS_TYPES_H => 1,
HAVE_SYS_UCRED_H => undef,
- HAVE_SYS_UN_H => undef,
HAVE_TERMIOS_H => undef,
HAVE_TYPEOF => undef,
HAVE_UCRED_H => undef,