riscv64: fix linking with binutils 2.40
[uclibc-ng.git] / libc / sysdeps / linux / x86_64 / __syscall_error.c
blob7f0f388c44b0b61ff00d7d9f1e208586a71ccea3
1 /* Wrapper for setting errno.
3 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
5 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
6 */
8 #include <errno.h>
9 #include <features.h>
11 /* This routine is jumped to by all the syscall handlers, to stash
12 * an error number into errno. */
13 long __syscall_error(void) attribute_hidden;
14 long __syscall_error(void)
16 register int err_no __asm__ ("%rcx");
17 __asm__ ("mov %rax, %rcx\n\t"
18 "neg %rcx");
19 __set_errno(err_no);
20 return -1;