about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/sparc/bits
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-02-24 13:37:02 +0000
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-06-15 10:42:11 -0300
commit7446e896334cdb5431997dcc30d7ca13768b467d (patch)
tree11867fc9bb17f23b9bb114b82fe9becbebadd094 /sysdeps/unix/sysv/linux/sparc/bits
parent7194337c3e1358b4586de45566064d5bb9c8a238 (diff)
downloadglibc-7446e896334cdb5431997dcc30d7ca13768b467d.tar.gz
glibc-7446e896334cdb5431997dcc30d7ca13768b467d.tar.xz
glibc-7446e896334cdb5431997dcc30d7ca13768b467d.zip
y2038: Add __USE_TIME_BITS64 support for socket-constants.h
It is only used for !__USE_MISC, the default way uses the kernel
headers.  The patch also adds the SO_TIMESTAMP, SO_TIMESTAMPNS, and
SO_TIMESTAMPING which uses new values for 64-bit time_t kernel
interfaces.

The __USE_TIME_BITS64 is not defined internally yet, although the
internal header is used when building the 64-bit stat implementations.

Reviewed-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'sysdeps/unix/sysv/linux/sparc/bits')
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/socket-constants.h36
1 files changed, 34 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/socket-constants.h b/sysdeps/unix/sysv/linux/sparc/bits/socket-constants.h
index a58d0b5f96..5c4ed76c8c 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/socket-constants.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/socket-constants.h
@@ -30,9 +30,41 @@
 #define SO_OOBINLINE 256
 #define SO_RCVBUF 4098
 #define SO_RCVLOWAT 2048
-#define SO_RCVTIMEO 8192
 #define SO_REUSEADDR 4
 #define SO_SNDBUF 4097
 #define SO_SNDLOWAT 4096
-#define SO_SNDTIMEO 16384
 #define SO_TYPE 4104
+
+#if __TIMESIZE == 64
+# define SO_RCVTIMEO 8192
+# define SO_SNDTIMEO 16384
+# define SO_TIMESTAMP 29
+# define SO_TIMESTAMPNS 33
+# define SO_TIMESTAMPING 35
+#else
+# define SO_RCVTIMEO_OLD 8192
+# define SO_SNDTIMEO_OLD 16384
+# define SO_RCVTIMEO_NEW 68
+# define SO_SNDTIMEO_NEW 69
+
+# define SO_TIMESTAMP_OLD 0x001d
+# define SO_TIMESTAMPNS_OLD 0x0021
+# define SO_TIMESTAMPING_OLD 0x0023
+# define SO_TIMESTAMP_NEW 0x0046
+# define SO_TIMESTAMPNS_NEW 0x0042
+# define SO_TIMESTAMPING_NEW 0x0043
+
+# ifdef __USE_TIME_BITS64
+#  define SO_RCVTIMEO SO_RCVTIMEO_NEW
+#  define SO_SNDTIMEO SO_SNDTIMEO_NEW
+#  define SO_TIMESTAMP SO_TIMESTAMP_NEW
+#  define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW
+#  define SO_TIMESTAMPING SO_TIMESTAMPING_NEW
+# else
+#  define SO_RCVTIMEO SO_RCVTIMEO_OLD
+#  define SO_SNDTIMEO SO_SNDTIMEO_OLD
+#  define SO_TIMESTAMP SO_TIMESTAMP_OLD
+#  define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD
+#  define SO_TIMESTAMPING SO_TIMESTAMPING_OLD
+# endif
+#endif