summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/i386/mmap64.S
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-07-06 22:40:33 +0000
committerMike Frysinger <vapier@gentoo.org>2005-07-06 22:40:33 +0000
commit76d80593426f5f77a51dcf694786576a37f3b208 (patch)
tree9e70c2ade4627510fe6173ae614683efc28de466 /libc/sysdeps/linux/i386/mmap64.S
parentd1de87b09ddd8f096d0191ffb0a694acea13d84b (diff)
Peter S. Mazinger writes: use the __syscall_error.c trick to handle setting errno
Diffstat (limited to 'libc/sysdeps/linux/i386/mmap64.S')
-rw-r--r--libc/sysdeps/linux/i386/mmap64.S30
1 files changed, 8 insertions, 22 deletions
diff --git a/libc/sysdeps/linux/i386/mmap64.S b/libc/sysdeps/linux/i386/mmap64.S
index 42d1bb69e..dde3b9ae1 100644
--- a/libc/sysdeps/linux/i386/mmap64.S
+++ b/libc/sysdeps/linux/i386/mmap64.S
@@ -65,6 +65,7 @@ mmap64:
movl FD(%esp), %edi
movl $__NR_mmap2, %eax /* System call number in %eax. */
+ /* Do the system call trap. */
int $0x80
/* Restore registers. */
@@ -75,7 +76,8 @@ mmap64:
/* If 0 > %eax > -4096 there was an error. */
cmpl $-4095,%eax
- jae __syscall_error
+ ja __error
+ /* Successful; return the syscall's value. */
ret
/* This means the offset value is too large. */
@@ -85,27 +87,11 @@ L_einval:
popl %ebx
popl %ebp
movl $-EINVAL, %eax
- jmp __syscall_error
-
-
-__syscall_error:
- negl %eax
- pushl %eax
-#ifdef __PIC__
- call .Lthere
-.Lthere:
- popl %ebx
- addl $_GLOBAL_OFFSET_TABLE_+[.- .Lthere ], %ebx
- call __errno_location@PLT
-#else
- call __errno_location
-#endif
- popl %ecx
- movl %ecx, (%eax)
- xorl %eax, %eax
- decl %eax
+ jmp __error
+
+__error:
+ call __syscall_error
-.Lsize:
-.size mmap64,.Lsize-mmap64
+.size mmap64,.-mmap64
#endif