summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/x86_64/__syscall_error.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-01-08 12:28:18 +0000
committerMike Frysinger <vapier@gentoo.org>2006-01-08 12:28:18 +0000
commitbc9ff8040ef8042ba858baf9c28b1825337ce4df (patch)
tree4fc3f9fd5bbc27a1d8d0e55021afc02d298affb9 /libc/sysdeps/linux/x86_64/__syscall_error.c
parenta83c32e036222fc33cd99fd9f97b067b5e6442dd (diff)
fix errno handling with some magical hacks
Diffstat (limited to 'libc/sysdeps/linux/x86_64/__syscall_error.c')
-rw-r--r--libc/sysdeps/linux/x86_64/__syscall_error.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libc/sysdeps/linux/x86_64/__syscall_error.c b/libc/sysdeps/linux/x86_64/__syscall_error.c
index de65a1f39..d8cf84c2b 100644
--- a/libc/sysdeps/linux/x86_64/__syscall_error.c
+++ b/libc/sysdeps/linux/x86_64/__syscall_error.c
@@ -22,8 +22,9 @@
/* This routine is jumped to by all the syscall handlers, to stash
* an error number into errno. */
-int attribute_hidden __syscall_error(int err_no)
+int attribute_hidden __syscall_error(void)
{
- __set_errno(err_no);
+ register int err_no asm("%rax");
+ __set_errno(-err_no);
return -1;
}