From df7d0dfb9c686df31149d09008ba92834bed9803 Mon Sep 17 00:00:00 2001 From: Jens Gustedt Date: Mon, 1 Sep 2014 00:46:23 +0200 Subject: use weak symbols for the POSIX functions that will be used by C threads The intent of this is to avoid name space pollution of the C threads implementation. This has two sides to it. First we have to provide symbols that wouldn't pollute the name space for the C threads implementation. Second we have to clean up some internal uses of POSIX functions such that they don't implicitly drag in such symbols. --- src/thread/pthread_key_create.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/thread/pthread_key_create.c') diff --git a/src/thread/pthread_key_create.c b/src/thread/pthread_key_create.c index a9187f7b..bfcd5976 100644 --- a/src/thread/pthread_key_create.c +++ b/src/thread/pthread_key_create.c @@ -9,7 +9,7 @@ static void nodtor(void *dummy) { } -int pthread_key_create(pthread_key_t *k, void (*dtor)(void *)) +int __pthread_key_create(pthread_key_t *k, void (*dtor)(void *)) { unsigned i = (uintptr_t)&k / 16 % PTHREAD_KEYS_MAX; unsigned j = i; @@ -31,7 +31,7 @@ int pthread_key_create(pthread_key_t *k, void (*dtor)(void *)) return EAGAIN; } -int pthread_key_delete(pthread_key_t k) +int __pthread_key_delete(pthread_key_t k) { keys[k] = 0; return 0; @@ -53,3 +53,6 @@ void __pthread_tsd_run_dtors() } } } + +weak_alias(__pthread_key_delete, pthread_key_delete); +weak_alias(__pthread_key_create, pthread_key_create); -- cgit v1.2.1