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/sparc/dl-syscalls.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'ldso/ldso/sparc') 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; \ } -- cgit v1.2.3