summaryrefslogtreecommitdiff
path: root/lib/libpthread/pthread.c
diff options
context:
space:
mode:
authorad <ad@NetBSD.org>2008-03-22 14:19:27 +0000
committerad <ad@NetBSD.org>2008-03-22 14:19:27 +0000
commit783e2f6db5806a1c899ed1dd3e1bfb32ea612c7e (patch)
tree2e5e26c47c97aecfe5457f9a617b944b20e51400 /lib/libpthread/pthread.c
parent978a8525ecf7fc1437eb9e8acbe49a387b1043f8 (diff)
Back out previous. It seems to expose another bug in libpthread/libc,
potentially errno being used before threading is up and running.
Diffstat (limited to 'lib/libpthread/pthread.c')
-rw-r--r--lib/libpthread/pthread.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/libpthread/pthread.c b/lib/libpthread/pthread.c
index 2123873f0ea..1ebcb881c8f 100644
--- a/lib/libpthread/pthread.c
+++ b/lib/libpthread/pthread.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread.c,v 1.98 2008/03/21 21:35:43 ad Exp $ */
+/* $NetBSD: pthread.c,v 1.99 2008/03/22 14:19:27 ad Exp $ */
/*-
* Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: pthread.c,v 1.98 2008/03/21 21:35:43 ad Exp $");
+__RCSID("$NetBSD: pthread.c,v 1.99 2008/03/22 14:19:27 ad Exp $");
#define __EXPOSE_STACK 1
@@ -918,6 +918,16 @@ pthread__cleanup_pop(int ex, void *store)
}
+int *
+pthread__errno(void)
+{
+ pthread_t self;
+
+ self = pthread__self();
+
+ return &(self->pt_errno);
+}
+
ssize_t _sys_write(int, const void *, size_t);
void