From: Rich Felker Date: Sat, 2 Nov 2019 00:11:08 +0000 (-0400) Subject: move time64 socket options from arch bits to top-level sys/socket.h X-Git-Tag: v1.2.0~65 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c71dbb24c947dc14f43960bfec4da670fccba580;p=oweals%2Fmusl.git move time64 socket options from arch bits to top-level sys/socket.h now that all 32-bit archs have 64-bit time types, the values for the time-related socket option macros can be treated as universal for 32-bit archs. the sys/socket.h mechanism for this predates arch/generic and is instead in the top-level header. x32, which does not use the new time64 values of the macros, already has its own overrides, so this commit does not affect it. --- diff --git a/arch/arm/bits/socket.h b/arch/arm/bits/socket.h deleted file mode 100644 index 4d1f645b..00000000 --- a/arch/arm/bits/socket.h +++ /dev/null @@ -1,5 +0,0 @@ -#define SO_TIMESTAMP 63 -#define SO_TIMESTAMPNS 64 -#define SO_TIMESTAMPING 65 -#define SO_RCVTIMEO 66 -#define SO_SNDTIMEO 67 diff --git a/arch/i386/bits/socket.h b/arch/i386/bits/socket.h deleted file mode 100644 index 4d1f645b..00000000 --- a/arch/i386/bits/socket.h +++ /dev/null @@ -1,5 +0,0 @@ -#define SO_TIMESTAMP 63 -#define SO_TIMESTAMPNS 64 -#define SO_TIMESTAMPING 65 -#define SO_RCVTIMEO 66 -#define SO_SNDTIMEO 67 diff --git a/arch/m68k/bits/socket.h b/arch/m68k/bits/socket.h deleted file mode 100644 index 4d1f645b..00000000 --- a/arch/m68k/bits/socket.h +++ /dev/null @@ -1,5 +0,0 @@ -#define SO_TIMESTAMP 63 -#define SO_TIMESTAMPNS 64 -#define SO_TIMESTAMPING 65 -#define SO_RCVTIMEO 66 -#define SO_SNDTIMEO 67 diff --git a/arch/microblaze/bits/socket.h b/arch/microblaze/bits/socket.h deleted file mode 100644 index 4d1f645b..00000000 --- a/arch/microblaze/bits/socket.h +++ /dev/null @@ -1,5 +0,0 @@ -#define SO_TIMESTAMP 63 -#define SO_TIMESTAMPNS 64 -#define SO_TIMESTAMPING 65 -#define SO_RCVTIMEO 66 -#define SO_SNDTIMEO 67 diff --git a/arch/mips/bits/socket.h b/arch/mips/bits/socket.h index 4ffc4d4a..02fbb88b 100644 --- a/arch/mips/bits/socket.h +++ b/arch/mips/bits/socket.h @@ -21,11 +21,6 @@ #define SO_ACCEPTCONN 0x1009 #define SO_PROTOCOL 0x1028 #define SO_DOMAIN 0x1029 -#define SO_TIMESTAMP 63 -#define SO_TIMESTAMPNS 64 -#define SO_TIMESTAMPING 65 -#define SO_RCVTIMEO 66 -#define SO_SNDTIMEO 67 #define SO_NO_CHECK 11 #define SO_PRIORITY 12 diff --git a/arch/mipsn32/bits/socket.h b/arch/mipsn32/bits/socket.h index 4ffc4d4a..02fbb88b 100644 --- a/arch/mipsn32/bits/socket.h +++ b/arch/mipsn32/bits/socket.h @@ -21,11 +21,6 @@ #define SO_ACCEPTCONN 0x1009 #define SO_PROTOCOL 0x1028 #define SO_DOMAIN 0x1029 -#define SO_TIMESTAMP 63 -#define SO_TIMESTAMPNS 64 -#define SO_TIMESTAMPING 65 -#define SO_RCVTIMEO 66 -#define SO_SNDTIMEO 67 #define SO_NO_CHECK 11 #define SO_PRIORITY 12 diff --git a/arch/or1k/bits/socket.h b/arch/or1k/bits/socket.h deleted file mode 100644 index 4d1f645b..00000000 --- a/arch/or1k/bits/socket.h +++ /dev/null @@ -1,5 +0,0 @@ -#define SO_TIMESTAMP 63 -#define SO_TIMESTAMPNS 64 -#define SO_TIMESTAMPING 65 -#define SO_RCVTIMEO 66 -#define SO_SNDTIMEO 67 diff --git a/arch/powerpc/bits/socket.h b/arch/powerpc/bits/socket.h index e5fa0f7a..b19ed42b 100644 --- a/arch/powerpc/bits/socket.h +++ b/arch/powerpc/bits/socket.h @@ -23,8 +23,3 @@ #define SO_RCVBUFFORCE 33 #define SO_PROTOCOL 38 #define SO_DOMAIN 39 -#define SO_TIMESTAMP 63 -#define SO_TIMESTAMPNS 64 -#define SO_TIMESTAMPING 65 -#define SO_RCVTIMEO 66 -#define SO_SNDTIMEO 67 diff --git a/arch/sh/bits/socket.h b/arch/sh/bits/socket.h deleted file mode 100644 index 4d1f645b..00000000 --- a/arch/sh/bits/socket.h +++ /dev/null @@ -1,5 +0,0 @@ -#define SO_TIMESTAMP 63 -#define SO_TIMESTAMPNS 64 -#define SO_TIMESTAMPING 65 -#define SO_RCVTIMEO 66 -#define SO_SNDTIMEO 67 diff --git a/include/sys/socket.h b/include/sys/socket.h index 4ea7be1e..a1c0b01c 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -225,15 +225,26 @@ struct linger { #endif #ifndef SO_RCVTIMEO +#if __LONG_MAX == 0x7fffffff +#define SO_RCVTIMEO 66 +#define SO_SNDTIMEO 67 +#else #define SO_RCVTIMEO 20 #define SO_SNDTIMEO 21 #endif +#endif #ifndef SO_TIMESTAMP +#if __LONG_MAX == 0x7fffffff +#define SO_TIMESTAMP 63 +#define SO_TIMESTAMPNS 64 +#define SO_TIMESTAMPING 65 +#else #define SO_TIMESTAMP 29 #define SO_TIMESTAMPNS 35 #define SO_TIMESTAMPING 37 #endif +#endif #define SO_SECURITY_AUTHENTICATION 22 #define SO_SECURITY_ENCRYPTION_TRANSPORT 23