summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMax Bachmann <kontakt@maxbachmann.de>2022-05-05 18:46:03 +0200
committerPauli <pauli@openssl.org>2022-07-08 14:08:45 +1000
commit081f3484593cdd3be2b7fdd8818c3f928ce729bc (patch)
treeabf9752f80ddb03021ce1b2ac4bcc0c1aad99f9c /include
parentd104c6ff7499b0638c82557ce94e284b00f74627 (diff)
Add config option OPENSSL_NO_UNIX_SOCK
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18256)
Diffstat (limited to 'include')
-rw-r--r--include/internal/sockets.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/internal/sockets.h b/include/internal/sockets.h
index 4701eb7e0e..bc1de716df 100644
--- a/include/internal/sockets.h
+++ b/include/internal/sockets.h
@@ -75,7 +75,7 @@ struct servent *PASCAL getservbyname(const char *, const char *);
# include <inet.h>
# else
# include <sys/socket.h>
-# ifndef NO_SYS_UN_H
+# if !defined(NO_SYS_UN_H) && defined(AF_UNIX) && !defined(OPENSSL_NO_UNIX_SOCK)
# include <sys/un.h>
# ifndef UNIX_PATH_MAX
# define UNIX_PATH_MAX sizeof(((struct sockaddr_un *)NULL)->sun_path)
@@ -123,6 +123,15 @@ struct servent *PASCAL getservbyname(const char *, const char *);
# endif
# endif
+/*
+ * Some platforms define AF_UNIX, but don't support it
+ */
+# if !defined(OPENSSL_NO_UNIX_SOCK)
+# if !defined(AF_UNIX) || defined(NO_SYS_UN_H)
+# define OPENSSL_NO_UNIX_SOCK
+# endif
+# endif
+
# define get_last_socket_error() errno
# define clear_socket_error() errno=0