diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-06-29 00:56:09 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-06-29 00:56:09 +0000 |
commit | 69ec4a5d65cdd4a2fdf2c94e1861464fa2caf7ce (patch) | |
tree | 45eb64f3ded1eb81dc606532c75038d445ea3be7 /libc/sysdeps/linux/x86_64/syscall.S | |
parent | 0f9f0d5305631211e03edbff44c6c3b5fc03e41f (diff) |
add syscall error handling with jockes simple errno setting solution
Diffstat (limited to 'libc/sysdeps/linux/x86_64/syscall.S')
-rw-r--r-- | libc/sysdeps/linux/x86_64/syscall.S | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/libc/sysdeps/linux/x86_64/syscall.S b/libc/sysdeps/linux/x86_64/syscall.S index 0ec272566..23ff07ac1 100644 --- a/libc/sysdeps/linux/x86_64/syscall.S +++ b/libc/sysdeps/linux/x86_64/syscall.S @@ -23,9 +23,10 @@ We need to do some arg shifting, the syscall_number will be in rax. */ -.globl syscall; -.type syscall,@function; -.align 16; +.text +.globl syscall +.type syscall,@function +.align 16 syscall: movq %rdi, %rax /* Syscall number -> rax. */ movq %rsi, %rdi /* shift arg1 - arg5. */ @@ -36,10 +37,10 @@ syscall: movq 8(%rsp),%r9 /* arg6 is on the stack. */ syscall /* Do the system call. */ cmpq $-4095, %rax /* Check %rax for error. */ - jae __syscall_error /* Branch forward if it failed. */ + jae __error /* Branch forward if it failed. */ ret /* Return to caller. */ -__syscall_error: - /* TODO: implement this ! :D */ +__error: + jmp __syscall_error -.size syscall,.-syscall; +.size syscall,.-syscall |