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