From b8361e2e12f612cf302bc03c2c9e7a648c37a84e Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Wed, 12 May 2004 22:54:59 +0000 Subject: Add a local '_dl_errno' to be used by syscalls in ldso, allowing useful syscall failure diagnostics. --- ldso/ldso/powerpc/dl-syscalls.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ldso/ldso/powerpc') diff --git a/ldso/ldso/powerpc/dl-syscalls.h b/ldso/ldso/powerpc/dl-syscalls.h index 3e561d661..8b8c3b9ef 100644 --- a/ldso/ldso/powerpc/dl-syscalls.h +++ b/ldso/ldso/powerpc/dl-syscalls.h @@ -19,6 +19,11 @@ #define __NR_stat 106 #define __NR_mprotect 125 + +/* We can't use the real errno in ldso, since it has not yet + * been dynamicly linked in yet. */ +extern int _dl_errno; + /* Here are the macros which define how this platform makes * system calls. This particular variant does _not_ set * errno (note how it is disabled in __syscall_return) since @@ -27,7 +32,7 @@ #undef __syscall_return #define __syscall_return(type) \ - return (__sc_err & 0x10000000 ? /*errno = __sc_ret,*/ __sc_ret = -1 : 0), \ + return (__sc_err & 0x10000000 ? _dl_errno = __sc_ret, __sc_ret = -1 : 0), \ (type) __sc_ret #undef __syscall_clobbers -- cgit v1.2.3