[uClibc-cvs] uClibc/ldso/ldso/sparc dl-syscalls.h,1.6,1.7

Erik Andersen andersen at uclibc.org
Wed May 12 22:55:02 UTC 2004


Update of /var/cvs/uClibc/ldso/ldso/sparc
In directory nail:/tmp/cvs-serv535/ldso/sparc

Modified Files:
	dl-syscalls.h 
Log Message:
Add a local '_dl_errno' to be used by syscalls in ldso, allowing
useful syscall failure diagnostics.


Index: dl-syscalls.h
===================================================================
RCS file: /var/cvs/uClibc/ldso/ldso/sparc/dl-syscalls.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- a/dl-syscalls.h	1 Feb 2004 08:30:55 -0000	1.6
+++ b/dl-syscalls.h	12 May 2004 22:54:59 -0000	1.7
@@ -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 @@
 		      : "o0", "cc"); \
 if (__res < -255 || __res >= 0) \
     return (type) __res; \
-/*errno = -__res; */\
+_dl_errno = -__res; \
 return -1; \
 }
 
@@ -60,7 +64,7 @@
 		      : "cc"); \
 if (__res < -255 || __res >= 0) \
 	return (type) __res; \
-/*errno = -__res;*/ \
+_dl_errno = -__res; \
 return -1; \
 }
 
@@ -81,7 +85,7 @@
 		      : "cc"); \
 if (__res < -255 || __res >= 0) \
 	return (type) __res; \
-/*errno = -__res;*/ \
+_dl_errno = -__res; \
 return -1; \
 }
 
@@ -103,7 +107,7 @@
 		      : "cc"); \
 if (__res < -255 || __res>=0) \
 	return (type) __res; \
-/*errno = -__res;*/ \
+_dl_errno = -__res; \
 return -1; \
 }
 
@@ -126,7 +130,7 @@
 		      : "cc"); \
 if (__res < -255 || __res>=0) \
 	return (type) __res; \
-/*errno = -__res;*/ \
+_dl_errno = -__res; \
 return -1; \
 } 
 
@@ -151,6 +155,6 @@
 		      : "cc"); \
 if (__res < -255 || __res>=0) \
 	return (type) __res; \
-/*errno = -__res; */\
+_dl_errno = -__res; \
 return -1; \
 }




More information about the uClibc-cvs mailing list