>From cef3df57e70c2678ee0e5c9ceacb7c0b748dce49 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 1 Nov 2019 20:11:08 -0400 Subject: [PATCH 15/17] 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. --- arch/arm/bits/socket.h | 5 ----- arch/i386/bits/socket.h | 5 ----- arch/m68k/bits/socket.h | 5 ----- arch/microblaze/bits/socket.h | 5 ----- arch/mips/bits/socket.h | 5 ----- arch/mipsn32/bits/socket.h | 5 ----- arch/or1k/bits/socket.h | 5 ----- arch/powerpc/bits/socket.h | 5 ----- arch/sh/bits/socket.h | 5 ----- include/sys/socket.h | 11 +++++++++++ 10 files changed, 11 insertions(+), 45 deletions(-) delete mode 100644 arch/arm/bits/socket.h delete mode 100644 arch/i386/bits/socket.h delete mode 100644 arch/m68k/bits/socket.h delete mode 100644 arch/microblaze/bits/socket.h delete mode 100644 arch/or1k/bits/socket.h delete mode 100644 arch/sh/bits/socket.h 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 -- 2.21.0