From eeb9042b8e12d6f543617eddb96f62ede55c6f7e Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 11 Aug 2020 18:59:48 +0200 Subject: [PATCH] LibC: Declare sockaddr_storage This type is guaranteed to fit the largest sockaddr_foo supported by the system. In our case, that's sockaddr_un. --- Libraries/LibC/sys/socket.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Libraries/LibC/sys/socket.h b/Libraries/LibC/sys/socket.h index 269158beb1..ba561b41f0 100644 --- a/Libraries/LibC/sys/socket.h +++ b/Libraries/LibC/sys/socket.h @@ -86,6 +86,13 @@ struct ucred { #define SO_BINDTODEVICE 7 #define SO_KEEPALIVE 9 +struct sockaddr_storage { + union { + char data[sizeof(sockaddr_un)]; + void* alignment; + }; +}; + int socket(int domain, int type, int protocol); int bind(int sockfd, const struct sockaddr* addr, socklen_t); int listen(int sockfd, int backlog);