about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--arch/aarch64/bits/socket.h31
-rw-r--r--arch/generic/bits/socket.h15
-rw-r--r--arch/mips/bits/socket.h16
-rw-r--r--arch/mips64/bits/socket.h32
-rw-r--r--arch/mipsn32/bits/socket.h16
-rw-r--r--arch/powerpc/bits/socket.h16
-rw-r--r--arch/powerpc64/bits/socket.h32
-rw-r--r--arch/riscv64/bits/socket.h17
-rw-r--r--arch/s390x/bits/socket.h17
-rw-r--r--arch/x86_64/bits/socket.h16
-rw-r--r--include/sys/socket.h34
11 files changed, 34 insertions, 208 deletions
diff --git a/arch/aarch64/bits/socket.h b/arch/aarch64/bits/socket.h
deleted file mode 100644
index 55337c8b..00000000
--- a/arch/aarch64/bits/socket.h
+++ /dev/null
@@ -1,31 +0,0 @@
-struct msghdr {
-	void *msg_name;
-	socklen_t msg_namelen;
-	struct iovec *msg_iov;
-#if __BYTE_ORDER == __BIG_ENDIAN
-	int __pad1, msg_iovlen;
-#else
-	int msg_iovlen, __pad1;
-#endif
-	void *msg_control;
-#if __BYTE_ORDER == __BIG_ENDIAN
-	int __pad2;
-	socklen_t msg_controllen;
-#else
-	socklen_t msg_controllen;
-	int __pad2;
-#endif
-	int msg_flags;
-};
-
-struct cmsghdr {
-#if __BYTE_ORDER == __BIG_ENDIAN
-	int __pad1;
-	socklen_t cmsg_len;
-#else
-	socklen_t cmsg_len;
-	int __pad1;
-#endif
-	int cmsg_level;
-	int cmsg_type;
-};
diff --git a/arch/generic/bits/socket.h b/arch/generic/bits/socket.h
index 1f73b995..e69de29b 100644
--- a/arch/generic/bits/socket.h
+++ b/arch/generic/bits/socket.h
@@ -1,15 +0,0 @@
-struct msghdr {
-	void *msg_name;
-	socklen_t msg_namelen;
-	struct iovec *msg_iov;
-	int msg_iovlen;
-	void *msg_control;
-	socklen_t msg_controllen;
-	int msg_flags;
-};
-
-struct cmsghdr {
-	socklen_t cmsg_len;
-	int cmsg_level;
-	int cmsg_type;
-};
diff --git a/arch/mips/bits/socket.h b/arch/mips/bits/socket.h
index b82c7d34..92551b9f 100644
--- a/arch/mips/bits/socket.h
+++ b/arch/mips/bits/socket.h
@@ -1,19 +1,3 @@
-struct msghdr {
-	void *msg_name;
-	socklen_t msg_namelen;
-	struct iovec *msg_iov;
-	int msg_iovlen;
-	void *msg_control;
-	socklen_t msg_controllen;
-	int msg_flags;
-};
-
-struct cmsghdr {
-	socklen_t cmsg_len;
-	int cmsg_level;
-	int cmsg_type;
-};
-
 #define SOCK_STREAM    2
 #define SOCK_DGRAM     1
 
diff --git a/arch/mips64/bits/socket.h b/arch/mips64/bits/socket.h
index aafb209c..519b9c8e 100644
--- a/arch/mips64/bits/socket.h
+++ b/arch/mips64/bits/socket.h
@@ -1,35 +1,3 @@
-struct msghdr {
-	void *msg_name;
-	socklen_t msg_namelen;
-	struct iovec *msg_iov;
-#if __BYTE_ORDER == __BIG_ENDIAN
-	int __pad1, msg_iovlen;
-#else
-	int msg_iovlen, __pad1;
-#endif
-	void *msg_control;
-#if __BYTE_ORDER == __BIG_ENDIAN
-	int __pad2;
-	socklen_t msg_controllen;
-#else
-	socklen_t msg_controllen;
-	int __pad2;
-#endif
-	int msg_flags;
-};
-
-struct cmsghdr {
-#if __BYTE_ORDER == __BIG_ENDIAN
-	int __pad1;
-	socklen_t cmsg_len;
-#else
-	socklen_t cmsg_len;
-	int __pad1;
-#endif
-	int cmsg_level;
-	int cmsg_type;
-};
-
 #define SOCK_STREAM    2
 #define SOCK_DGRAM     1
 #define SOL_SOCKET     65535
diff --git a/arch/mipsn32/bits/socket.h b/arch/mipsn32/bits/socket.h
index b82c7d34..92551b9f 100644
--- a/arch/mipsn32/bits/socket.h
+++ b/arch/mipsn32/bits/socket.h
@@ -1,19 +1,3 @@
-struct msghdr {
-	void *msg_name;
-	socklen_t msg_namelen;
-	struct iovec *msg_iov;
-	int msg_iovlen;
-	void *msg_control;
-	socklen_t msg_controllen;
-	int msg_flags;
-};
-
-struct cmsghdr {
-	socklen_t cmsg_len;
-	int cmsg_level;
-	int cmsg_type;
-};
-
 #define SOCK_STREAM    2
 #define SOCK_DGRAM     1
 
diff --git a/arch/powerpc/bits/socket.h b/arch/powerpc/bits/socket.h
index a94b8bdb..557e324f 100644
--- a/arch/powerpc/bits/socket.h
+++ b/arch/powerpc/bits/socket.h
@@ -1,19 +1,3 @@
-struct msghdr {
-	void *msg_name;
-	socklen_t msg_namelen;
-	struct iovec *msg_iov;
-	int msg_iovlen;
-	void *msg_control;
-	socklen_t msg_controllen;
-	int msg_flags;
-};
-
-struct cmsghdr {
-	socklen_t cmsg_len;
-	int cmsg_level;
-	int cmsg_type;
-};
-
 #define SO_DEBUG        1
 #define SO_REUSEADDR    2
 #define SO_TYPE         3
diff --git a/arch/powerpc64/bits/socket.h b/arch/powerpc64/bits/socket.h
index dae47302..557e324f 100644
--- a/arch/powerpc64/bits/socket.h
+++ b/arch/powerpc64/bits/socket.h
@@ -1,35 +1,3 @@
-struct msghdr {
-	void *msg_name;
-	socklen_t msg_namelen;
-	struct iovec *msg_iov;
-#if __BYTE_ORDER == __BIG_ENDIAN
-	int __pad1, msg_iovlen;
-#else
-	int msg_iovlen, __pad1;
-#endif
-	void *msg_control;
-#if __BYTE_ORDER == __BIG_ENDIAN
-	int __pad2;
-	socklen_t msg_controllen;
-#else
-	socklen_t msg_controllen;
-	int __pad2;
-#endif
-	int msg_flags;
-};
-
-struct cmsghdr {
-#if __BYTE_ORDER == __BIG_ENDIAN
-	int __pad1;
-	socklen_t cmsg_len;
-#else
-	socklen_t cmsg_len;
-	int __pad1;
-#endif
-	int cmsg_level;
-	int cmsg_type;
-};
-
 #define SO_DEBUG        1
 #define SO_REUSEADDR    2
 #define SO_TYPE         3
diff --git a/arch/riscv64/bits/socket.h b/arch/riscv64/bits/socket.h
deleted file mode 100644
index e2fd64cf..00000000
--- a/arch/riscv64/bits/socket.h
+++ /dev/null
@@ -1,17 +0,0 @@
-struct msghdr {
-	void *msg_name;
-	socklen_t msg_namelen;
-	struct iovec *msg_iov;
-	int msg_iovlen, __pad1;
-	void *msg_control;
-	socklen_t msg_controllen;
-	int __pad2;
-	int msg_flags;
-};
-
-struct cmsghdr {
-	socklen_t cmsg_len;
-	int __pad1;
-	int cmsg_level;
-	int cmsg_type;
-};
diff --git a/arch/s390x/bits/socket.h b/arch/s390x/bits/socket.h
deleted file mode 100644
index bd4b20c4..00000000
--- a/arch/s390x/bits/socket.h
+++ /dev/null
@@ -1,17 +0,0 @@
-struct msghdr {
-	void *msg_name;
-	socklen_t msg_namelen;
-	struct iovec *msg_iov;
-	int __pad1, msg_iovlen;
-	void *msg_control;
-	int __pad2;
-	socklen_t msg_controllen;
-	int msg_flags;
-};
-
-struct cmsghdr {
-	int __pad1;
-	socklen_t cmsg_len;
-	int cmsg_level;
-	int cmsg_type;
-};
diff --git a/arch/x86_64/bits/socket.h b/arch/x86_64/bits/socket.h
deleted file mode 100644
index a4c89f3d..00000000
--- a/arch/x86_64/bits/socket.h
+++ /dev/null
@@ -1,16 +0,0 @@
-struct msghdr {
-	void *msg_name;
-	socklen_t msg_namelen;
-	struct iovec *msg_iov;
-	int msg_iovlen, __pad1;
-	void *msg_control;
-	socklen_t msg_controllen, __pad2;
-	int msg_flags;
-};
-
-struct cmsghdr {
-	socklen_t cmsg_len;
-	int __pad1;
-	int cmsg_level;
-	int cmsg_type;
-};
diff --git a/include/sys/socket.h b/include/sys/socket.h
index 6be699d9..4ea7be1e 100644
--- a/include/sys/socket.h
+++ b/include/sys/socket.h
@@ -19,6 +19,40 @@ extern "C" {
 
 #include <bits/socket.h>
 
+struct msghdr {
+	void *msg_name;
+	socklen_t msg_namelen;
+	struct iovec *msg_iov;
+#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __BIG_ENDIAN
+	int __pad1;
+#endif
+	int msg_iovlen;
+#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __LITTLE_ENDIAN
+	int __pad1;
+#endif
+	void *msg_control;
+#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __BIG_ENDIAN
+	int __pad2;
+#endif
+	socklen_t msg_controllen;
+#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __LITTLE_ENDIAN
+	int __pad2;
+#endif
+	int msg_flags;
+};
+
+struct cmsghdr {
+#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __BIG_ENDIAN
+	int __pad1;
+#endif
+	socklen_t cmsg_len;
+#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __LITTLE_ENDIAN
+	int __pad1;
+#endif
+	int cmsg_level;
+	int cmsg_type;
+};
+
 #ifdef _GNU_SOURCE
 struct ucred {
 	pid_t pid;