@@ -66,39 +66,3 @@
#define TARGET_SCM_TIMESTAMPING_PKTINFO 58
#define TARGET_SO_PEERGROUPS 59
#define TARGET_SO_ZEROCOPY 60
-
-/** sock_type - Socket types
- *
- * Please notice that for binary compat reasons ALPHA has to
- * override the enum sock_type in include/linux/net.h, so
- * we define ARCH_HAS_SOCKET_TYPES here.
- *
- * @SOCK_STREAM - stream (connection) socket
- * @SOCK_DGRAM - datagram (conn.less) socket
- * @SOCK_RAW - raw socket
- * @SOCK_RDM - reliably-delivered message
- * @SOCK_SEQPACKET - sequential packet socket
- * @SOCK_DCCP - Datagram Congestion Control Protocol socket
- * @SOCK_PACKET - linux specific way of getting packets at the dev level.
- * For writing rarp and other similar things on the user
- * level.
- * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag.
- * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag.
- */
-
-enum sock_type {
- TARGET_SOCK_STREAM = 1,
- TARGET_SOCK_DGRAM = 2,
- TARGET_SOCK_RAW = 3,
- TARGET_SOCK_RDM = 4,
- TARGET_SOCK_SEQPACKET = 5,
- TARGET_SOCK_DCCP = 6,
- TARGET_SOCK_PACKET = 10,
- TARGET_SOCK_CLOEXEC = 010000000,
- TARGET_SOCK_NONBLOCK = 0x40000000,
-};
-
-#define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1)
-#define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX - 1. */
-
-#define ARCH_HAS_SOCKET_TYPES 1
@@ -71,33 +71,3 @@
#define TARGET_SO_PEERGROUPS 0x4034
#define TARGET_SO_ZEROCOPY 0x4035
-/** sock_type - Socket types - default values
- *
- * @SOCK_STREAM - stream (connection) socket
- * @SOCK_DGRAM - datagram (conn.less) socket
- * @SOCK_RAW - raw socket
- * @SOCK_RDM - reliably-delivered message
- * @SOCK_SEQPACKET - sequential packet socket
- * @SOCK_DCCP - Datagram Congestion Control Protocol socket
- * @SOCK_PACKET - linux specific way of getting packets at the dev level.
- * For writing rarp and other similar things on the user
- * level.
- * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag.
- * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag.
- */
-enum sock_type {
- TARGET_SOCK_STREAM = 1,
- TARGET_SOCK_DGRAM = 2,
- TARGET_SOCK_RAW = 3,
- TARGET_SOCK_RDM = 4,
- TARGET_SOCK_SEQPACKET = 5,
- TARGET_SOCK_DCCP = 6,
- TARGET_SOCK_PACKET = 10,
- TARGET_SOCK_CLOEXEC = 010000000,
- TARGET_SOCK_NONBLOCK = 0x40000000,
-};
-
-#define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1)
-#define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX - 1. */
-
-#define ARCH_HAS_SOCKET_TYPES 1
@@ -70,38 +70,3 @@
#define TARGET_SCM_TIMESTAMPING_PKTINFO 58
#define TARGET_SO_PEERGROUPS 59
#define TARGET_SO_ZEROCOPY 60
-
-/** sock_type - Socket types
- *
- * Please notice that for binary compat reasons MIPS has to
- * override the enum sock_type in include/linux/net.h, so
- * we define ARCH_HAS_SOCKET_TYPES here.
- *
- * @SOCK_DGRAM - datagram (conn.less) socket
- * @SOCK_STREAM - stream (connection) socket
- * @SOCK_RAW - raw socket
- * @SOCK_RDM - reliably-delivered message
- * @SOCK_SEQPACKET - sequential packet socket
- * @SOCK_DCCP - Datagram Congestion Control Protocol socket
- * @SOCK_PACKET - linux specific way of getting packets at the dev level.
- * For writing rarp and other similar things on the user
- * level.
- * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag.
- * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag.
- */
-enum sock_type {
- TARGET_SOCK_DGRAM = 1,
- TARGET_SOCK_STREAM = 2,
- TARGET_SOCK_RAW = 3,
- TARGET_SOCK_RDM = 4,
- TARGET_SOCK_SEQPACKET = 5,
- TARGET_SOCK_DCCP = 6,
- TARGET_SOCK_PACKET = 10,
- TARGET_SOCK_CLOEXEC = 02000000,
- TARGET_SOCK_NONBLOCK = 0x0080,
-};
-
-#define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1)
-#define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX - 1. */
-
-#define ARCH_HAS_SOCKET_TYPES 1
@@ -103,34 +103,34 @@
#endif
-#ifndef ARCH_HAS_SOCKET_TYPES
- /** sock_type - Socket types - default values
- *
- * @SOCK_STREAM - stream (connection) socket
- * @SOCK_DGRAM - datagram (conn.less) socket
- * @SOCK_RAW - raw socket
- * @SOCK_RDM - reliably-delivered message
- * @SOCK_SEQPACKET - sequential packet socket
- * @SOCK_DCCP - Datagram Congestion Control Protocol socket
- * @SOCK_PACKET - linux specific way of getting packets at the dev level.
- * For writing rarp and other similar things on the user
- * level.
- * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag.
- * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag.
- */
- enum sock_type {
- TARGET_SOCK_STREAM = 1,
- TARGET_SOCK_DGRAM = 2,
- TARGET_SOCK_RAW = 3,
- TARGET_SOCK_RDM = 4,
- TARGET_SOCK_SEQPACKET = 5,
- TARGET_SOCK_DCCP = 6,
- TARGET_SOCK_PACKET = 10,
- TARGET_SOCK_CLOEXEC = 02000000,
- TARGET_SOCK_NONBLOCK = 04000,
- };
-
- #define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1)
- #define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX - 1. */
+#if defined(TARGET_MIPS)
+ #define TARGET_SOCK_DGRAM 1
+ #define TARGET_SOCK_STREAM 2
+#else
+ #define TARGET_SOCK_STREAM 1
+ #define TARGET_SOCK_DGRAM 2
+#endif
+#define TARGET_SOCK_RAW 3
+#define TARGET_SOCK_RDM 4
+#define TARGET_SOCK_SEQPACKET 5
+#define TARGET_SOCK_DCCP 6
+#define TARGET_SOCK_PACKET 10
+
+#if defined(TARGET_ALPHA) || defined(TARGET_HPPA)
+ #define TARGET_SOCK_CLOEXEC 010000000
+#else
+ #define TARGET_SOCK_CLOEXEC 02000000 /* 0x400000 */
#endif
+
+#if defined(TARGET_MIPS)
+ #define TARGET_SOCK_NONBLOCK 0x0080
+#elif defined(TARGET_SPARC)
+ #define TARGET_SOCK_NONBLOCK 0x4000
+#elif defined(TARGET_ALPHA) || defined(TARGET_HPPA)
+ #define TARGET_SOCK_NONBLOCK 0x40000000
+#else
+ #define TARGET_SOCK_NONBLOCK 04000
+#endif
+
+#define TARGET_SOCK_TYPE_MASK 0xf
@@ -67,38 +67,3 @@
#define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002
#define TARGET_SO_SECURITY_ENCRYPTION_NETWORK 0x5004
-/** sock_type - Socket types
- *
- * Please notice that for binary compat reasons SPARC has to
- * override the enum sock_type in include/linux/net.h, so
- * we define ARCH_HAS_SOCKET_TYPES here.
- *
- * @SOCK_STREAM - stream (connection) socket
- * @SOCK_DGRAM - datagram (conn.less) socket
- * @SOCK_RAW - raw socket
- * @SOCK_RDM - reliably-delivered message
- * @SOCK_SEQPACKET - sequential packet socket
- * @SOCK_DCCP - Datagram Congestion Control Protocol socket
- * @SOCK_PACKET - linux specific way of getting packets at the dev level.
- * For writing rarp and other similar things on the user
- * level.
- * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag.
- * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag.
- */
-
-enum sock_type {
- TARGET_SOCK_STREAM = 1,
- TARGET_SOCK_DGRAM = 2,
- TARGET_SOCK_RAW = 3,
- TARGET_SOCK_RDM = 4,
- TARGET_SOCK_SEQPACKET = 5,
- TARGET_SOCK_DCCP = 6,
- TARGET_SOCK_PACKET = 10,
- TARGET_SOCK_CLOEXEC = 0x400000,
- TARGET_SOCK_NONBLOCK = 0x4000,
-};
-
-#define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1)
-#define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX - 1. */
-
-#define ARCH_HAS_SOCKET_TYPES 1
remove unnecessary sock_type enum and other unused surrounding code to allow for per arch sockbits to mirror better linux headers for maintenance Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> --- linux-user/alpha/sockbits.h | 36 ---------------------------- linux-user/hppa/sockbits.h | 30 ----------------------- linux-user/mips/sockbits.h | 35 --------------------------- linux-user/socket.h | 58 ++++++++++++++++++++++----------------------- linux-user/sparc/sockbits.h | 35 --------------------------- 5 files changed, 29 insertions(+), 165 deletions(-)