From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14894 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH] missing parts to time64 switchover Date: Fri, 1 Nov 2019 10:56:17 -0400 Message-ID: <20191101145617.GN16318@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="yaPAUYI/0vT2YKpA" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="99100"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-14910-gllmg-musl=m.gmane.org@lists.openwall.com Fri Nov 01 15:56:34 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1iQYLq-000Pdf-CS for gllmg-musl@m.gmane.org; Fri, 01 Nov 2019 15:56:34 +0100 Original-Received: (qmail 11371 invoked by uid 550); 1 Nov 2019 14:56:31 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 11336 invoked from network); 1 Nov 2019 14:56:30 -0000 Content-Disposition: inline Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:14894 Archived-At: --yaPAUYI/0vT2YKpA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline The time64 switchover I had been testing and hoped to push yesterday turned out to be missing the ioctl and sockopt bits, which I eventually remembered I'd omitted in the late-summer i386-only draft because making a bunch more archs have arch variants for these did not seem fun. So, I've worked out some changes to allow top-level socket.h to do a lot more. The msghdr move is pretty much orthogonal, aside from interaction with x32. It's probably not perfect at this point, but I think it's an improvement, and short of errors good enough to commit. It brings things closer to a state of only needing arch-specific bits for archs that actually do weird things, rather than repeating things that are universal to all 32-bit archs or all 64-bit archs on a per-arch basis. These patches should apply ok on the last time64 switchover draft posted to the list. But I'm posting them more for the sake of a (very brief) comment period about what they're doing, and to have a record of them as individual patches -- some of them will be squashed since they yield ABI-inconsistent revisions if left split. Rich --yaPAUYI/0vT2YKpA Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0001-fix-x32-msghdr-struct-by-removing-x32-bits-socket.h.patch" >From d95f4ec080bafae7f154a475b90a7f0468aa3bf9 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 31 Oct 2019 22:55:39 -0400 Subject: [PATCH 1/6] fix x32 msghdr struct by removing x32 bits/socket.h being that it contains pointers and (from the kernel perspective, which is wrong) size_t members, x32 uses the 32-bit version of the structure, not a half-32-bit, half-64-bit layout like we had here. the x86_64 definition was inadvertently copied when x32 was first added. unlike errors in the opposite direction (missing padding), this error was not easily detected breakage, because the layout of the commonly used initial subset of members still matched. breakage could only be observed in the presence of control messages or flags. --- arch/x32/bits/socket.h | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 arch/x32/bits/socket.h diff --git a/arch/x32/bits/socket.h b/arch/x32/bits/socket.h deleted file mode 100644 index a4c89f3d..00000000 --- a/arch/x32/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; -}; -- 2.21.0 --yaPAUYI/0vT2YKpA Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0002-move-msghdr-and-cmsghdr-out-of-bits-socket.h.patch" >From 93ea221c619cc027c8b90626fc745ca1c9a09898 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 31 Oct 2019 23:09:48 -0400 Subject: [PATCH 2/6] move msghdr and cmsghdr out of bits/socket.h these structures can now be defined generically in terms of endianness and long size. previously, the 32-bit archs all shared a common definition from the generic bits header, and each 64-bit arch had to repeat the 64-bit version, with endian conditionals if the arch had variants of each endianness. I would prefer getting rid of the preprocessor conditionals for padding and instead using unnamed bitfield members, like commit 9b2921bea1d5017832e1b45d1fd64220047a9802 did for struct timespec. however, at present sendmsg, recvmsg, and recvmmsg need access to the padding members by name to zero them. this could perhaps be cleaned up in the future. --- arch/aarch64/bits/socket.h | 31 ------------------------------- arch/generic/bits/socket.h | 15 --------------- arch/mips/bits/socket.h | 16 ---------------- arch/mips64/bits/socket.h | 32 -------------------------------- arch/mipsn32/bits/socket.h | 16 ---------------- arch/powerpc/bits/socket.h | 16 ---------------- arch/powerpc64/bits/socket.h | 32 -------------------------------- arch/riscv64/bits/socket.h | 17 ----------------- arch/s390x/bits/socket.h | 17 ----------------- arch/x86_64/bits/socket.h | 16 ---------------- include/sys/socket.h | 34 ++++++++++++++++++++++++++++++++++ 11 files changed, 34 insertions(+), 208 deletions(-) delete mode 100644 arch/aarch64/bits/socket.h delete mode 100644 arch/riscv64/bits/socket.h delete mode 100644 arch/s390x/bits/socket.h delete mode 100644 arch/x86_64/bits/socket.h 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 04077654..b1dfeace 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -19,6 +19,40 @@ extern "C" { #include +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; -- 2.21.0 --yaPAUYI/0vT2YKpA Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0003-add-back-x32-bits-socket.h-defining-time-related-soc.patch" >From bdef372be16617ff1318896773041fdc1a3a0280 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 31 Oct 2019 23:21:35 -0400 Subject: [PATCH 3/6] add back x32 bits/socket.h defining time-related socket options these definitions are merely copied from the top-level sys/socket.h, so there is no functional change at this time. however, the top-level definitions will change to use the time64 "_NEW" versions on 32-bit archs when time_t is switched over to 64-bit. this commit ensures that change will be suppressed on x32. --- arch/x32/bits/socket.h | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 arch/x32/bits/socket.h diff --git a/arch/x32/bits/socket.h b/arch/x32/bits/socket.h new file mode 100644 index 00000000..8d830010 --- /dev/null +++ b/arch/x32/bits/socket.h @@ -0,0 +1,5 @@ +#define SO_RCVTIMEO 20 +#define SO_SNDTIMEO 21 +#define SO_TIMESTAMP 29 +#define SO_TIMESTAMPNS 35 +#define SO_TIMESTAMPING 37 -- 2.21.0 --yaPAUYI/0vT2YKpA Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0004-add-x32-bits-ioctl_fix.h-defining-time-related-socki.patch" >From a1054a6b898bba88e21a329f25709b1dccad1bff Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 31 Oct 2019 23:40:10 -0400 Subject: [PATCH 4/6] add x32 bits/ioctl_fix.h defining time-related sockios macros these definitions are copied from generic bits/ioctl.h, so that x32 keeps the "_OLD" versions (which are already time64 on x32) when 32-bit archs switch to 64-bit time_t. --- arch/x32/bits/ioctl_fix.h | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 arch/x32/bits/ioctl_fix.h diff --git a/arch/x32/bits/ioctl_fix.h b/arch/x32/bits/ioctl_fix.h new file mode 100644 index 00000000..79f5c281 --- /dev/null +++ b/arch/x32/bits/ioctl_fix.h @@ -0,0 +1,4 @@ +#undef SIOCGSTAMP +#under SIOCGSTAMPNS +#define SIOCGSTAMP 0x8906 +#define SIOCGSTAMPNS 0x8907 -- 2.21.0 --yaPAUYI/0vT2YKpA Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0005-convert-ioctl-sockios-macro-definitions-for-time64.patch" >From 244e72f613ac69a79f4531a82cc36c6d26c50860 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 1 Nov 2019 10:34:03 -0400 Subject: [PATCH 5/6] convert ioctl sockios macro definitions for time64 this should be squashed as a fixup to the time64 switchover. --- arch/generic/bits/ioctl.h | 5 +++++ arch/mips/bits/ioctl.h | 4 ++-- arch/mipsn32/bits/ioctl.h | 2 ++ arch/powerpc/bits/ioctl.h | 4 ++-- arch/sh/bits/ioctl.h | 4 ++-- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/arch/generic/bits/ioctl.h b/arch/generic/bits/ioctl.h index d1a6c035..60ae8b85 100644 --- a/arch/generic/bits/ioctl.h +++ b/arch/generic/bits/ioctl.h @@ -104,7 +104,12 @@ #define FIOGETOWN 0x8903 #define SIOCGPGRP 0x8904 #define SIOCATMARK 0x8905 +#if __LONG_MAX == 0x7fffffff +#define SIOCGSTAMP _IOR(0x89, 6, char[16]) +#define SIOCGSTAMPNS _IOR(0x89, 7, char[16]) +#else #define SIOCGSTAMP 0x8906 #define SIOCGSTAMPNS 0x8907 +#endif #include diff --git a/arch/mips/bits/ioctl.h b/arch/mips/bits/ioctl.h index e277c3f0..e20bf19e 100644 --- a/arch/mips/bits/ioctl.h +++ b/arch/mips/bits/ioctl.h @@ -110,5 +110,5 @@ #define SIOCATMARK _IOR('s', 7, int) #define SIOCSPGRP _IOW('s', 8, pid_t) #define SIOCGPGRP _IOR('s', 9, pid_t) -#define SIOCGSTAMP 0x8906 -#define SIOCGSTAMPNS 0x8907 +#define SIOCGSTAMP _IOR(0x89, 6, char[16]) +#define SIOCGSTAMPNS _IOR(0x89, 7, char[16]) diff --git a/arch/mipsn32/bits/ioctl.h b/arch/mipsn32/bits/ioctl.h index e277c3f0..f0e39563 100644 --- a/arch/mipsn32/bits/ioctl.h +++ b/arch/mipsn32/bits/ioctl.h @@ -112,3 +112,5 @@ #define SIOCGPGRP _IOR('s', 9, pid_t) #define SIOCGSTAMP 0x8906 #define SIOCGSTAMPNS 0x8907 +#define SIOCGSTAMP _IOR(0x89, 6, char[16]) +#define SIOCGSTAMPNS _IOR(0x89, 7, char[16]) diff --git a/arch/powerpc/bits/ioctl.h b/arch/powerpc/bits/ioctl.h index b6cbb18f..ac9bfd20 100644 --- a/arch/powerpc/bits/ioctl.h +++ b/arch/powerpc/bits/ioctl.h @@ -116,5 +116,5 @@ #define FIOGETOWN 0x8903 #define SIOCGPGRP 0x8904 #define SIOCATMARK 0x8905 -#define SIOCGSTAMP 0x8906 -#define SIOCGSTAMPNS 0x8907 +#define SIOCGSTAMP _IOR(0x89, 6, char[16]) +#define SIOCGSTAMPNS _IOR(0x89, 7, char[16]) diff --git a/arch/sh/bits/ioctl.h b/arch/sh/bits/ioctl.h index c4305655..370b6901 100644 --- a/arch/sh/bits/ioctl.h +++ b/arch/sh/bits/ioctl.h @@ -108,5 +108,5 @@ #define SIOCATMARK _IOR('s', 7, int) #define SIOCSPGRP _IOW('s', 8, int) #define SIOCGPGRP _IOW('s', 9, int) -#define SIOCGSTAMP _IOR('s', 100, char[8]) -#define SIOCGSTAMPNS _IOR('s', 101, char[8]) +#define SIOCGSTAMP _IOR(0x89, 6, char[16]) +#define SIOCGSTAMPNS _IOR(0x89, 7, char[16]) -- 2.21.0 --yaPAUYI/0vT2YKpA Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0006-convert-socket-option-macro-definitions-for-time64.patch" >From d51f6dee3644111813c54efeccad2fe26b953883 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 1 Nov 2019 10:41:02 -0400 Subject: [PATCH 6/6] convert socket option macro definitions for time64 this should be squashed as a fixup to the time64 switchover. --- arch/mips/bits/socket.h | 7 +++++-- arch/mipsn32/bits/socket.h | 7 +++++-- arch/powerpc/bits/socket.h | 7 +++++-- include/sys/socket.h | 7 +++++++ 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/arch/mips/bits/socket.h b/arch/mips/bits/socket.h index 92551b9f..4ffc4d4a 100644 --- a/arch/mips/bits/socket.h +++ b/arch/mips/bits/socket.h @@ -16,13 +16,16 @@ #define SO_RCVBUF 0x1002 #define SO_SNDLOWAT 0x1003 #define SO_RCVLOWAT 0x1004 -#define SO_RCVTIMEO 0x1006 -#define SO_SNDTIMEO 0x1005 #define SO_ERROR 0x1007 #define SO_TYPE 0x1008 #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 92551b9f..4ffc4d4a 100644 --- a/arch/mipsn32/bits/socket.h +++ b/arch/mipsn32/bits/socket.h @@ -16,13 +16,16 @@ #define SO_RCVBUF 0x1002 #define SO_SNDLOWAT 0x1003 #define SO_RCVLOWAT 0x1004 -#define SO_RCVTIMEO 0x1006 -#define SO_SNDTIMEO 0x1005 #define SO_ERROR 0x1007 #define SO_TYPE 0x1008 #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/powerpc/bits/socket.h b/arch/powerpc/bits/socket.h index 557e324f..e5fa0f7a 100644 --- a/arch/powerpc/bits/socket.h +++ b/arch/powerpc/bits/socket.h @@ -15,8 +15,6 @@ #define SO_REUSEPORT 15 #define SO_RCVLOWAT 16 #define SO_SNDLOWAT 17 -#define SO_RCVTIMEO 18 -#define SO_SNDTIMEO 19 #define SO_PASSCRED 20 #define SO_PEERCRED 21 #define SO_ACCEPTCONN 30 @@ -25,3 +23,8 @@ #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/include/sys/socket.h b/include/sys/socket.h index b1dfeace..a17898ce 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -225,6 +225,13 @@ struct linger { #endif #ifndef SO_RCVTIMEO +#if __LONG_MAX == 0x7fffffff +#define SO_TIMESTAMP 63 +#define SO_TIMESTAMPNS 64 +#define SO_TIMESTAMPING 65 +#define SO_RCVTIMEO 66 +#define SO_SNDTIMEO 67 +#else #define SO_RCVTIMEO 20 #define SO_SNDTIMEO 21 #define SO_TIMESTAMP 29 -- 2.21.0 --yaPAUYI/0vT2YKpA--