summaryrefslogtreecommitdiff
path: root/lib/libpthread/pthread_specific.c
diff options
context:
space:
mode:
authorad <ad@NetBSD.org>2007-11-27 20:58:26 +0000
committerad <ad@NetBSD.org>2007-11-27 20:58:26 +0000
commit4084ca7f3fe50b29ad22fa4aa4049e62cd065573 (patch)
tree1ac442f21ae2bf1a27714f839e8a7809791273fd /lib/libpthread/pthread_specific.c
parentd5e9b90716f622207f1403ab0be58282fdb2f2b6 (diff)
Add thr_curcpu(), pthread_curcpu_np().
Diffstat (limited to 'lib/libpthread/pthread_specific.c')
-rw-r--r--lib/libpthread/pthread_specific.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/libpthread/pthread_specific.c b/lib/libpthread/pthread_specific.c
index d13ee9027ad..1fe148e4ff8 100644
--- a/lib/libpthread/pthread_specific.c
+++ b/lib/libpthread/pthread_specific.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread_specific.c,v 1.12 2007/11/13 01:21:32 ad Exp $ */
+/* $NetBSD: pthread_specific.c,v 1.13 2007/11/27 20:58:26 ad Exp $ */
/*-
* Copyright (c) 2001, 2007 The NetBSD Foundation, Inc.
@@ -37,15 +37,18 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: pthread_specific.c,v 1.12 2007/11/13 01:21:32 ad Exp $");
+__RCSID("$NetBSD: pthread_specific.c,v 1.13 2007/11/27 20:58:26 ad Exp $");
/* Functions and structures dealing with thread-specific data */
#include "pthread.h"
#include "pthread_int.h"
+#include <sys/lwpctl.h>
+
__strong_alias(__libc_thr_setspecific,pthread_setspecific)
__strong_alias(__libc_thr_getspecific,pthread_getspecific)
+__strong_alias(__libc_thr_curcpu,pthread_curcpu_np)
int
pthread_setspecific(pthread_key_t key, const void *value)
@@ -69,5 +72,13 @@ pthread_setspecific(pthread_key_t key, const void *value)
void *
pthread_getspecific(pthread_key_t key)
{
+
return pthread__self()->pt_specific[key];
}
+
+unsigned int
+pthread_curcpu_np(void)
+{
+
+ return pthread__self()->pt_lwpctl->lc_curcpu;
+}
hitespaceplunky 2007-03-12Not KAUTH_DEVICE_TTY_OPEN but KAUTH_GENERIC_ISSUSER is used.kiyohara 2007-03-06fix typoplunky 2007-03-04Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.christos 2007-02-20Supprot Bluetooth HCI UART (H4) driver and daemon.kiyohara