summaryrefslogtreecommitdiff
path: root/ldso/ldso/sparc
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/sparc
parent21da42ed9484a71756f5848d0f15dabbee3c6f41 (diff)
Add a local '_dl_errno' to be used by syscalls in ldso, allowing
useful syscall failure diagnostics.
Diffstat (limited to 'ldso/ldso/sparc')
-rw-r--r--ldso/ldso/sparc/dl-syscalls.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/ldso/ldso/sparc/dl-syscalls.h b/ldso/ldso/sparc/dl-syscalls.h
index 4222b2468..218e8a289 100644
--- a/ldso/ldso/sparc/dl-syscalls.h
+++ b/ldso/ldso/sparc/dl-syscalls.h
@@ -19,6 +19,10 @@
#define __NR_stat 38
#define __NR_mprotect 74
+/* 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
@@ -40,7 +44,7 @@ __asm__ __volatile__ ("t 0x10\n\t" \
: "o0", "cc"); \
if (__res < -255 || __res >= 0) \
return (type) __res; \
-/*errno = -__res; */\
+_dl_errno = -__res; \
return -1; \
}
@@ -60,7 +64,7 @@ __asm__ __volatile__ ("t 0x10\n\t" \
: "cc"); \
if (__res < -255 || __res >= 0) \
return (type) __res; \
-/*errno = -__res;*/ \
+_dl_errno = -__res; \
return -1; \
}
@@ -81,7 +85,7 @@ __asm__ __volatile__ ("t 0x10\n\t" \
: "cc"); \
if (__res < -255 || __res >= 0) \
return (type) __res; \
-/*errno = -__res;*/ \
+_dl_errno = -__res; \
return -1; \
}
@@ -103,7 +107,7 @@ __asm__ __volatile__ ("t 0x10\n\t" \
: "cc"); \
if (__res < -255 || __res>=0) \
return (type) __res; \
-/*errno = -__res;*/ \
+_dl_errno = -__res; \
return -1; \
}
@@ -126,7 +130,7 @@ __asm__ __volatile__ ("t 0x10\n\t" \
: "cc"); \
if (__res < -255 || __res>=0) \
return (type) __res; \
-/*errno = -__res;*/ \
+_dl_errno = -__res; \
return -1; \
}
@@ -151,6 +155,6 @@ __asm__ __volatile__ ("t 0x10\n\t" \
: "cc"); \
if (__res < -255 || __res>=0) \
return (type) __res; \
-/*errno = -__res; */\
+_dl_errno = -__res; \
return -1; \
}