@@ -124,7 +124,8 @@ ENTRY(__clone)
.LerrorRest:
/* Something bad happened -- no child created */
bl __syscall_error, %rp
- sub %r0, %ret0, %arg0
+ copy %ret0, %arg0
+
ldw -84(%sp), %rp
/* Return after setting errno, ret0 is set to -1 by __syscall_error. */
bv %r0(%rp)
@@ -133,7 +134,8 @@ ENTRY(__clone)
.LerrorSanity:
/* Sanity checks failed, return -1, and set errno to EINVAL. */
bl __syscall_error, %rp
- ldi EINVAL, %arg0
+ ldi -EINVAL, %arg0
+
ldw -84(%sp), %rp
bv %r0(%rp)
ldwm -64(%sp), %r4
similarity index 68%
rename from sysdeps/unix/sysv/linux/hppa/sysdep.c
rename to sysdeps/unix/sysv/linux/hppa/syscall_error.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 1997-2020 Free Software Foundation, Inc.
+/* Linux wrappers for setting errno. HPPA version.
+ Copyright (C) 2020 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
@@ -12,16 +13,13 @@
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, see
+ License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
-#include <errno.h>
+#ifndef _SYSCALL_ERROR_H
+#define _SYSCALL_ERROR_H
-/* This routine is jumped to by all the syscall handlers, to stash
- an error number into errno. */
-int
-__syscall_error (int err_no)
-{
- __set_errno (err_no);
- return -1;
-}
+#define SYSCALL_ERROR_FUNC 1
+#define SYSCALL_ERROR_FUNC_ATTR
+
+#endif