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