00db10
The patch originally submitted corrected behaviour on s390 and s390x.
00db10
The i686 change was added in order to maintain parity.
00db10
00db10
Author: Stefan Liebler <stli@linux.vnet.ibm.com>
00db10
00db10
Index: b/sysdeps/unix/sysv/linux/s390/s390-32/socket.S
00db10
===================================================================
00db10
--- a/sysdeps/unix/sysv/linux/s390/s390-32/socket.S
00db10
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/socket.S
00db10
@@ -99,8 +99,8 @@ ENTRY(__socket)
00db10
 	l       %r15,0(0,%r15)          /* load back chain */
00db10
 	lm      %r6,15,24(%r15)         /* load registers */
00db10
 
00db10
-	/* gpr2 is < 0 if there was an error.  */
00db10
-	lhi     %r0,-125
00db10
+	/* gpr2 is in [-4095, -1] if there was an error.  */
00db10
+	lhi     %r0,-4095
00db10
 	clr     %r2,%r0
00db10
 	jnl     SYSCALL_ERROR_LABEL
00db10
 
00db10
Index: b/sysdeps/unix/sysv/linux/s390/s390-64/socket.S
00db10
===================================================================
00db10
--- a/sysdeps/unix/sysv/linux/s390/s390-64/socket.S
00db10
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/socket.S
00db10
@@ -99,8 +99,8 @@ ENTRY(__socket)
00db10
         lg      %r15,0(%r15)            /* Load back chain.  */
00db10
         lmg     %r6,15,48(%r15)         /* Load registers.  */
00db10
 
00db10
-	/* gpr2 is < 0 if there was an error.  */
00db10
-        lghi    %r0,-125 
00db10
+	/* gpr2 is in [-4095, -1] if there was an error.  */
00db10
+        lghi    %r0,-4095
00db10
         clgr    %r2,%r0
00db10
         jgnl    SYSCALL_ERROR_LABEL
00db10
  
00db10
Index: b/sysdeps/unix/sysv/linux/i386/socket.S
00db10
===================================================================
00db10
--- a/sysdeps/unix/sysv/linux/i386/socket.S
00db10
+++ b/sysdeps/unix/sysv/linux/i386/socket.S
00db10
@@ -63,8 +63,8 @@ ENTRY (__socket)
00db10
 	movl %edx, %ebx
00db10
 	cfi_restore (3)
00db10
 
00db10
-	/* %eax is < 0 if there was an error.  */
00db10
-	cmpl $-125, %eax
00db10
+	/* %eax is in [-4095, -1] if there was an error.  */
00db10
+	cmpl $-4095, %eax
00db10
 	jae SYSCALL_ERROR_LABEL
00db10
 
00db10
 	/* Successful; return the syscall's value.  */
00db10
@@ -108,8 +108,8 @@ ENTRY (__socket)
00db10
 	cfi_restore (6)
00db10
 	cfi_adjust_cfa_offset(-4)
00db10
 
00db10
-	/* %eax is < 0 if there was an error.  */
00db10
-	cmpl $-125, %eax
00db10
+	/* %eax is in [-4095, -1] if there was an error.  */
00db10
+	cmpl $-4095, %eax
00db10
 	jae SYSCALL_ERROR_LABEL
00db10
 
00db10
 	/* Successful; return the syscall's value.  */