summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/x86_64/__syscall_error.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-06-29 00:56:09 +0000
committerMike Frysinger <vapier@gentoo.org>2005-06-29 00:56:09 +0000
commit69ec4a5d65cdd4a2fdf2c94e1861464fa2caf7ce (patch)
tree45eb64f3ded1eb81dc606532c75038d445ea3be7 /libc/sysdeps/linux/x86_64/__syscall_error.c
parent0f9f0d5305631211e03edbff44c6c3b5fc03e41f (diff)
add syscall error handling with jockes simple errno setting solution
Diffstat (limited to 'libc/sysdeps/linux/x86_64/__syscall_error.c')
-rw-r--r--libc/sysdeps/linux/x86_64/__syscall_error.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/x86_64/__syscall_error.c b/libc/sysdeps/linux/x86_64/__syscall_error.c
new file mode 100644
index 000000000..f0a699575
--- /dev/null
+++ b/libc/sysdeps/linux/x86_64/__syscall_error.c
@@ -0,0 +1,28 @@
+/* Wrapper for setting errno.
+ Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <errno.h>
+
+/* 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)
+{
+ __set_errno(err_no);
+ return -1;
+}