summaryrefslogtreecommitdiff
path: root/lib/libc/arch/alpha/SYS.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/arch/alpha/SYS.h')
-rw-r--r--lib/libc/arch/alpha/SYS.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/libc/arch/alpha/SYS.h b/lib/libc/arch/alpha/SYS.h
index c1bb2bef372..b84d0801aac 100644
--- a/lib/libc/arch/alpha/SYS.h
+++ b/lib/libc/arch/alpha/SYS.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: SYS.h,v 1.13 2015/10/23 04:39:24 guenther Exp $ */
+/* $OpenBSD: SYS.h,v 1.14 2016/05/16 16:20:58 guenther Exp $ */
/* $NetBSD: SYS.h,v 1.4 1996/10/17 03:03:53 cgd Exp $ */
/*
@@ -29,8 +29,13 @@
*/
#include <machine/asm.h>
+#include <machine/pal.h> /* for PAL_rdunique */
#include <sys/syscall.h>
+
+/* offsetof(struct tib, tib_errno) - offsetof(struct tib, __tib_tcb) */
+#define TCB_OFFSET_ERRNO (-12)
+
/*
* We define a hidden alias with the prefix "_libc_" for each global symbol
* that may be used internally. By referencing _libc_x instead of x, other
@@ -67,7 +72,11 @@
LLABEL(name,0): \
LDGP(gp); \
beq a3, LLABEL(name,1); \
- jmp zero, __cerror; \
+ mov v0, t0; \
+ call_pal PAL_rdunique; \
+ stl t0, TCB_OFFSET_ERRNO(v0); \
+ ldiq v0, -1; \
+ RET; \
LLABEL(name,1):
#define __LEAF(p,n,e) \