From 69ec4a5d65cdd4a2fdf2c94e1861464fa2caf7ce Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 29 Jun 2005 00:56:09 +0000 Subject: add syscall error handling with jockes simple errno setting solution --- libc/sysdeps/linux/x86_64/syscall.S | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'libc/sysdeps/linux/x86_64/syscall.S') 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 -- cgit v1.2.3