summaryrefslogtreecommitdiffstats
path: root/lib/libc/amd64
diff options
context:
space:
mode:
authorjb <jb@FreeBSD.org>1998-04-30 09:32:48 +0000
committerjb <jb@FreeBSD.org>1998-04-30 09:32:48 +0000
commitae9a13b7c7848f8fd7d426888e36b3d6ce0ef960 (patch)
tree995f80d191ccc87b00aa61d84befb491b234d410 /lib/libc/amd64
parent96749f4d5ca2e27c5daeac508a44d3f47663c38b (diff)
downloadFreeBSD-src-ae9a13b7c7848f8fd7d426888e36b3d6ce0ef960.zip
FreeBSD-src-ae9a13b7c7848f8fd7d426888e36b3d6ce0ef960.tar.gz
Make cerror thread aware by calling __error() to get a pointer to the
thread-specific error variable. This change make libc use the same cerror code that libc_r has been using.
Diffstat (limited to 'lib/libc/amd64')
-rw-r--r--lib/libc/amd64/sys/cerror.S27
1 files changed, 5 insertions, 22 deletions
diff --git a/lib/libc/amd64/sys/cerror.S b/lib/libc/amd64/sys/cerror.S
index 2d8f935..d3e74eb 100644
--- a/lib/libc/amd64/sys/cerror.S
+++ b/lib/libc/amd64/sys/cerror.S
@@ -33,21 +33,22 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: cerror.S,v 1.8 1997/02/22 14:59:29 peter Exp $
*/
#if defined(SYSLIBC_RCS) && !defined(lint)
.text
- .asciz "$Id$"
+ .asciz "$Id: cerror.S,v 1.8 1997/02/22 14:59:29 peter Exp $"
#endif /* SYSLIBC_RCS and not lint */
#include "SYS.h"
.globl HIDENAME(cerror)
-#ifdef _THREAD_SAFE
/*
- * Threaded version using __error().
+ * The __error() function is thread aware. For non-threaded
+ * programs and the initial threaded in threaded programs,
+ * it returns a pointer to the global errno variable.
*/
.globl CNAME(__error)
.type CNAME(__error),@function
@@ -67,21 +68,3 @@ HIDENAME(cerror):
movl $-1,%edx
ret
-#else /* _THREAD_SAFE */
- /*
- * Non-threaded version using global errno.
- */
- .globl CNAME(errno)
-HIDENAME(cerror):
-#ifdef PIC
- /* The caller must execute the PIC prologue before jumping to cerror. */
- movl PIC_GOT(CNAME(errno)),%ecx
- movl %eax,(%ecx)
- PIC_EPILOGUE
-#else
- movl %eax,CNAME(errno)
-#endif
- movl $-1,%eax
- movl $-1,%edx
- ret
-#endif /* _THREAD_SAFE */
OpenPOWER on IntegriCloud