summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-02-09 23:56:30 +0000
committerMike Frysinger <vapier@gentoo.org>2006-02-09 23:56:30 +0000
commit1c294afa13d9d9fa9e299fbc677b959044285bcd (patch)
tree1e900fddce7708944a0302d74d7d438fead96975 /libc/sysdeps/linux
parent9bd4cab1c71f6168b2cdfb86fe49d5373265afa1 (diff)
fix errno setting
Diffstat (limited to 'libc/sysdeps/linux')
-rw-r--r--libc/sysdeps/linux/x86_64/__syscall_error.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libc/sysdeps/linux/x86_64/__syscall_error.c b/libc/sysdeps/linux/x86_64/__syscall_error.c
index ff2d9f64c..448f50983 100644
--- a/libc/sysdeps/linux/x86_64/__syscall_error.c
+++ b/libc/sysdeps/linux/x86_64/__syscall_error.c
@@ -13,7 +13,9 @@
int __syscall_error(void) attribute_hidden;
int __syscall_error(void)
{
- register int err_no asm("%rax");
- __set_errno(-err_no);
+ register int err_no __asm__ ("%rcx");
+ __asm__ ("mov %rax, %rcx\n\t"
+ "neg %rcx");
+ __set_errno(err_no);
return -1;
}