Skip to contentSkip to conversation

provide y2038 safe socket constants

PATCH In review Vineet Gupta 3 participants 15 messages Mar 29, 2020 – Apr 19, 2020 Synopsys ARC architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 provide y2038 safe socket constants

These will be used by upcoming RV32 and ARC ports and any future ports

---
 sysdeps/unix/sysv/linux/bits/socket-constants.h | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
sysdeps/unix/sysv/linux/bits/socket-constants.h +12 -2
index 9dcc19cd5380..8a48ae7d0ca2 100644
@@ -20,6 +20,8 @@
 # error "Never include <bits/socket-constants.h> directly; use <sys/socket.h> instead."
 #endif
 
+#include <bits/timesize.h>
+
 #define SOL_SOCKET 1
 #define SO_ACCEPTCONN 30
 #define SO_BROADCAST 6
@@ -30,9 +32,17 @@
 #define SO_OOBINLINE 10
 #define SO_RCVBUF 8
 #define SO_RCVLOWAT 18
-#define SO_RCVTIMEO 20
+#if __TIMESIZE == 64 && __WORDSIZE == 32
+# define SO_RCVTIMEO 66
+#else
+# define SO_RCVTIMEO 20
+#endif
 #define SO_REUSEADDR 2
 #define SO_SNDBUF 7
 #define SO_SNDLOWAT 19
-#define SO_SNDTIMEO 21
+#if __TIMESIZE == 64 && __WORDSIZE == 32
+# define SO_SNDTIMEO 67
+#else
+# define SO_SNDTIMEO 21
+#endif
 #define SO_TYPE 3
Signature · 7 lines
2.20.1


_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
#1 lore raw

ping !

Quoted 31 lines · Vineet Gupta

These will be used by upcoming RV32 and ARC ports and any future ports

---
 sysdeps/unix/sysv/linux/bits/socket-constants.h | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
sysdeps/unix/sysv/linux/bits/socket-constants.h +7 -1
index 9dcc19cd5380..8a48ae7d0ca2 100644
@@ -20,6 +20,8 @@
 # error "Never include <bits/socket-constants.h> directly; use <sys/socket.h> instead."
 #endif
 
+#include <bits/timesize.h>
+
 #define SOL_SOCKET 1
 #define SO_ACCEPTCONN 30
 #define SO_BROADCAST 6
@@ -30,9 +32,17 @@
 #define SO_OOBINLINE 10
 #define SO_RCVBUF 8
 #define SO_RCVLOWAT 18
-#define SO_RCVTIMEO 20
+#if __TIMESIZE == 64 && __WORDSIZE == 32
+# define SO_RCVTIMEO 66
+#else
+# define SO_RCVTIMEO 20
+#endif

sysdeps/unix/sysv/linux/bits/socket-constants.h line 48

Quoted 10 lines
sysdeps/unix/sysv/linux/bits/socket-constants.h +5 -1
 #define SO_REUSEADDR 2
 #define SO_SNDBUF 7
 #define SO_SNDLOWAT 19
-#define SO_SNDTIMEO 21
+#if __TIMESIZE == 64 && __WORDSIZE == 32
+# define SO_SNDTIMEO 67
+#else
+# define SO_SNDTIMEO 21
+#endif
 #define SO_TYPE 3

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#2 lore raw
In reply to Vineet Gupta

* Vineet Gupta via Libc-alpha:

sysdeps/unix/sysv/linux/bits/socket-constants.h

Quoted 11 lines

These will be used by upcoming RV32 and ARC ports and any future ports

---
 sysdeps/unix/sysv/linux/bits/socket-constants.h | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
sysdeps/unix/sysv/linux/bits/socket-constants.h +0 -0
index 9dcc19cd5380..8a48ae7d0ca2 100644

What about the parallel changes to the sysdeps overrides? I would expect changes for hppa, mips, powerpc. (Not sure about the alpha situation.)

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#3 lore raw
Quoted 2 lines · Florian Weimer

What about the parallel changes to the sysdeps overrides? I would> expect changes for hppa, mips, powerpc. (Not sure about the alpha situation.)

This patch fixes the existing/future asm-generic ABI enabled arches and the ones you refer to are not. So IMHO that would be a separate patch if at all.

But if they do need fixing, I'm all up for it - except that I'm not sure if their ABI is changing too. Which brings us (me) to a fundamental question, how are those arches going to be made y2038 safe (me goes and reads the big wiki page)

Thx,
-Vineet

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#4 lore raw

* Vineet Gupta:

Quoted 7 lines · Florian Weimer
Quoted 2 lines

What about the parallel changes to the sysdeps overrides? I would> expect changes for hppa, mips, powerpc. (Not sure about the alpha situation.)

This patch fixes the existing/future asm-generic ABI enabled arches and the ones you refer to are not. So IMHO that would be a separate patch if at all.

Ahh, I think the commit message could make this clearer (although it it's somewhat implied). The commit message also lacks a period at the end.

But is the conditional correct for x32? It has to be keep using the old macro definitions.

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#5 lore raw

+CC libc-alpha which got lost in the thread.

Quoted 6 lines · Florian Weimer

* Vineet Gupta:

Quoted 4 lines · Florian Weimer
Quoted 2 lines

What about the parallel changes to the sysdeps overrides? I would> expect changes for hppa, mips, powerpc. (Not sure about the alpha situation.)

Quoted 6 lines
Quoted 3 lines

This patch fixes the existing/future asm-generic ABI enabled arches and the ones you refer to are not. So IMHO that would be a separate patch if at all.

Ahh, I think the commit message could make this clearer (although it it's somewhat implied).

Sure I can make it more explicit.

Quoted 2 lines

The commit message also lacks a period at the
end.

Will fix for v2.

Quoted 2 lines

But is the conditional correct for x32? It has to be keep using the old macro definitions.

I was not sure as some of the other patches in area don't seem to do that. Hence I CC'ed Stephan who had earlier commented on x32.

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#6 lore raw
In reply to Florian Weimer
Quoted 3 lines · Florian Weimer

What about the parallel changes to the sysdeps overrides? I would expect changes for hppa, mips, powerpc. (Not sure about the alpha situation.)

This fix is only about the case where the *default* ABI in glibc requires these different values.

The header will need further changes (to use a conditional not based on __TIMESIZE) when _TIME_BITS=64 is supported on platforms that currently have 32-bit time_t. That's the point at which changes for other architectures are needed - once we have an appropriate conditional for "the current compilation uses 64-bit time but kernel long is 32-bit" (or something like that).

I'm concerned the present patch is wrong for x32, however; that has __TIMESIZE == 64 && __WORDSIZE == 32 but should use the old values; the patch should be using __SYSCALL_WORDSIZE when available in place of __WORDSIZE.

Signature · 7 lines
Joseph S. Myers
[email protected]

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
#7 lore raw
Quoted 4 lines · Joseph Myers

I'm concerned the present patch is wrong for x32, however; that has __TIMESIZE == 64 && __WORDSIZE == 32 but should use the old values; the patch should be using __SYSCALL_WORDSIZE when available in place of __WORDSIZE.

Something like below ?

-#if __TIMESIZE == 64 && __WORDSIZE == 32

+#if TIMESIZE == 64 && (__WORDSIZE == 32 \
     && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32))

Also is it ok to littler the code (multiple times, this patch and else where) with this or should we define a new __32BIT_ARCH_NOT_X32 or some such ?
_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#8 lore raw

Review

Quoted 12 lines · Vineet Gupta via Libc-alpha
Quoted 4 lines · Joseph Myers

I'm concerned the present patch is wrong for x32, however; that has __TIMESIZE == 64 && __WORDSIZE == 32 but should use the old values; the patch should be using __SYSCALL_WORDSIZE when available in place of __WORDSIZE.

Something like below ?

(quoted diff) +1 -1
-#if __TIMESIZE == 64 && __WORDSIZE == 32
 
+#if TIMESIZE == 64 && (__WORDSIZE == 32 \
     && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32))

Yes, that sort of thing.

Signature · 7 lines
Joseph S. Myers
[email protected]

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
#9 lore raw

PATCH v2 1/1 provide y2038 safe socket constants for default/asm-generic ABI

These will be used by upcoming RV32 and ARC ports and any future ports.

---
This is a straight copy of code originally written by Alistair, hence adding his SOB as well

---
 sysdeps/unix/sysv/linux/bits/socket-constants.h | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
sysdeps/unix/sysv/linux/bits/socket-constants.h +14 -2
index 9dcc19cd5380..d02e1cbc7cf1 100644
@@ -20,6 +20,8 @@
 # error "Never include <bits/socket-constants.h> directly; use <sys/socket.h> instead."
 #endif
 
+#include <bits/timesize.h>
+
 #define SOL_SOCKET 1
 #define SO_ACCEPTCONN 30
 #define SO_BROADCAST 6
@@ -30,9 +32,19 @@
 #define SO_OOBINLINE 10
 #define SO_RCVBUF 8
 #define SO_RCVLOWAT 18
-#define SO_RCVTIMEO 20
+#if (__TIMESIZE == 64 && __WORDSIZE == 32 \
+     && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32))
+# define SO_RCVTIMEO 66
+#else
+# define SO_RCVTIMEO 20
+#endif
 #define SO_REUSEADDR 2
 #define SO_SNDBUF 7
 #define SO_SNDLOWAT 19
-#define SO_SNDTIMEO 21
+#if (__TIMESIZE == 64 && __WORDSIZE == 32 \
+     && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32))
+# define SO_SNDTIMEO 67
+#else
+# define SO_SNDTIMEO 21
+#endif
 #define SO_TYPE 3
Signature · 7 lines
2.20.1


_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
#10 lore raw

Re: [PATCH v2] provide y2038 safe socket constants for default/asm-generic ABI

Quoted 4 lines · Vineet Gupta via Libc-alpha

These will be used by upcoming RV32 and ARC ports and any future ports.

ping !

Quoted 33 lines

---
This is a straight copy of code originally written by Alistair, hence adding his SOB as well

---
 sysdeps/unix/sysv/linux/bits/socket-constants.h | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
sysdeps/unix/sysv/linux/bits/socket-constants.h +8 -1
index 9dcc19cd5380..d02e1cbc7cf1 100644
@@ -20,6 +20,8 @@
 # error "Never include <bits/socket-constants.h> directly; use <sys/socket.h> instead."
 #endif
 
+#include <bits/timesize.h>
+
 #define SOL_SOCKET 1
 #define SO_ACCEPTCONN 30
 #define SO_BROADCAST 6
@@ -30,9 +32,19 @@
 #define SO_OOBINLINE 10
 #define SO_RCVBUF 8
 #define SO_RCVLOWAT 18
-#define SO_RCVTIMEO 20
+#if (__TIMESIZE == 64 && __WORDSIZE == 32 \
+     && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32))
+# define SO_RCVTIMEO 66
+#else
+# define SO_RCVTIMEO 20
+#endif
 #define SO_REUSEADDR 2

sysdeps/unix/sysv/linux/bits/socket-constants.h line 50

Quoted 10 lines
sysdeps/unix/sysv/linux/bits/socket-constants.h +6 -1
 #define SO_SNDBUF 7
 #define SO_SNDLOWAT 19
-#define SO_SNDTIMEO 21
+#if (__TIMESIZE == 64 && __WORDSIZE == 32 \
+     && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32))
+# define SO_SNDTIMEO 67
+#else
+# define SO_SNDTIMEO 21
+#endif
 #define SO_TYPE 3

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#11 lore raw

Re: [PATCH v2] provide y2038 safe socket constants for default/asm-generic ABI

Quoted 7 lines · Vineet Gupta via Libc-alpha
Quoted 4 lines · Vineet Gupta via Libc-alpha

These will be used by upcoming RV32 and ARC ports and any future ports.

ping !

ping ^2 !

Quoted 36 lines
Quoted 36 lines

---
This is a straight copy of code originally written by Alistair, hence adding his SOB as well

---
 sysdeps/unix/sysv/linux/bits/socket-constants.h | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
sysdeps/unix/sysv/linux/bits/socket-constants.h +8 -2
index 9dcc19cd5380..d02e1cbc7cf1 100644
@@ -20,6 +20,8 @@
 # error "Never include <bits/socket-constants.h> directly; use <sys/socket.h> instead."
 #endif
 
+#include <bits/timesize.h>
+
 #define SOL_SOCKET 1
 #define SO_ACCEPTCONN 30
 #define SO_BROADCAST 6
@@ -30,9 +32,19 @@
 #define SO_OOBINLINE 10
 #define SO_RCVBUF 8
 #define SO_RCVLOWAT 18
-#define SO_RCVTIMEO 20
+#if (__TIMESIZE == 64 && __WORDSIZE == 32 \
+     && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32))
+# define SO_RCVTIMEO 66
+#else
+# define SO_RCVTIMEO 20
+#endif
 #define SO_REUSEADDR 2
 #define SO_SNDBUF 7
 #define SO_SNDLOWAT 19
-#define SO_SNDTIMEO 21
Quoted 9 lines

sysdeps/unix/sysv/linux/bits/socket-constants.h line 50

Quoted 8 lines
sysdeps/unix/sysv/linux/bits/socket-constants.h +6 -0
+#if (__TIMESIZE == 64 && __WORDSIZE == 32 \
+     && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32))
+# define SO_SNDTIMEO 67
+#else
+# define SO_SNDTIMEO 21
+#endif
 #define SO_TYPE 3

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc