summaryrefslogtreecommitdiff
path: root/ldso/ldso/powerpc/dl-syscalls.h
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-05-12 22:54:59 +0000
committerEric Andersen <andersen@codepoet.org>2004-05-12 22:54:59 +0000
commitb8361e2e12f612cf302bc03c2c9e7a648c37a84e (patch)
treefbb89653743acec76d1b441b97f4025a1aaef046 /ldso/ldso/powerpc/dl-syscalls.h
parent21da42ed9484a71756f5848d0f15dabbee3c6f41 (diff)
Add a local '_dl_errno' to be used by syscalls in ldso, allowing
useful syscall failure diagnostics.
Diffstat (limited to 'ldso/ldso/powerpc/dl-syscalls.h')
-rw-r--r--ldso/ldso/powerpc/dl-syscalls.h7
1 files changed, 6 insertions, 1 deletions
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