libc: consolidate pthread stub functions
authorSimon Schubert <simon.schubert@epfl.ch>
Tue, 26 May 2009 20:15:47 +0000 (22:15 +0200)
committerSimon Schubert <simon.schubert@epfl.ch>
Wed, 27 May 2009 09:46:27 +0000 (11:46 +0200)
To Hasso's and my surprise we are maintaining two sets of stub functions
for pthread.  These stubs are present so that consumers that are thread
aware, but don't require pthreads, will successfully link even without
-lpthread.

pthread_fake.c was introduced for external consumers, I believe Xorg.
It provided externally visible weak symbols for pthread_* functions that
all returned an error.

_pthread_stubs.c was introduced later so that libc could be made pthread
aware.  It provided only stub functions that are used by libc itself,
provided by weak symbols for _pthread_* (notice leading underscore).
These functions returned always success, so that libc could operate
properly.

This consolidation now provides weak symbols for both pthread_* and
_pthread_* for all functions defined by libpthread, except for
pthread_create.  These functions return success and/or behave properly.

lib/libc/gen/Makefile.inc
lib/libc/gen/_pthread_stubs.c
lib/libc/gen/pthread_fake.c [deleted file]

index 2d7f76b..ec0a7fe 100644 (file)
@@ -24,7 +24,7 @@ SRCS+=  _pthread_stubs.c _rand48.c _spinlock_stub.c _thread_init.c \
        msgget.c msgrcv.c msgsnd.c nftw.c nice.c \
        nlist.c nrand48.c ntp_gettime.c opendir.c \
        pause.c pmadvise.c popen.c posix_spawn.c posixshm.c \
-       psignal.c pthread_fake.c pw_scan.c pwcache.c \
+       psignal.c pw_scan.c pwcache.c \
        raise.c readdir.c readpassphrase.c rewinddir.c \
        scandir.c seed48.c seekdir.c semconfig.c semctl.c semget.c semop.c \
        setdomainname.c sethostname.c setjmperr.c setmode.c setprogname.c \
index 5c6ae7b..1e5e5af 100644 (file)
  * $DragonFly: src/lib/libc/gen/_pthread_stubs.c,v 1.4 2005/05/09 12:43:40 davidxu Exp $
  */
 
-#include <signal.h>
-#include <pthread.h>
-#include <pthread_np.h>
-
-int    _pthread_cond_init_stub(pthread_cond_t *, const pthread_condattr_t *);
-int    _pthread_cond_signal_stub(pthread_cond_t *);
-int    _pthread_cond_wait_stub(pthread_cond_t *, pthread_mutex_t *);
-void   *_pthread_getspecific_stub(pthread_key_t);
-int    _pthread_key_create_stub(pthread_key_t *, void (*)(void *));
-int    _pthread_key_delete_stub(pthread_key_t);
-int    _pthread_main_np_stub(void);
-int    _pthread_mutex_destroy_stub(pthread_mutex_t *);
-int    _pthread_mutex_init_stub(pthread_mutex_t *,
-                                const pthread_mutexattr_t *);
-int    _pthread_mutex_lock_stub(pthread_mutex_t *);
-int    _pthread_mutex_trylock_stub(pthread_mutex_t *);
-int    _pthread_mutex_unlock_stub(pthread_mutex_t *);
-int    _pthread_mutexattr_init_stub(pthread_mutexattr_t *);
-int    _pthread_mutexattr_destroy_stub(pthread_mutexattr_t *);
-int    _pthread_mutexattr_settype_stub(pthread_mutexattr_t *, int);
-int    _pthread_once_stub(pthread_once_t *, void (*)(void));
-int    _pthread_rwlock_init_stub(pthread_rwlock_t *,
-                                 const pthread_rwlockattr_t *);
-int    _pthread_rwlock_destroy_stub(pthread_rwlock_t *);
-int    _pthread_rwlock_rdlock_stub(pthread_rwlock_t *);
-int    _pthread_rwlock_tryrdlock_stub(pthread_rwlock_t *);
-int    _pthread_rwlock_trywrlock_stub(pthread_rwlock_t *);
-int    _pthread_rwlock_unlock_stub(pthread_rwlock_t *);
-int    _pthread_rwlock_wrlock_stub(pthread_rwlock_t *);
-int    _pthread_setspecific_stub(pthread_key_t, const void *);
-int    _pthread_sigmask_stub(int, const sigset_t *, sigset_t *);
-
-/* define a null pthread structure just to satisfy _pthread_self */
-struct pthread {
-};
-
-static struct pthread main_thread;
+#include <sys/cdefs.h>
+#include <stdlib.h>
 
 /*
  * Weak symbols: All libc internal usage of these functions should
@@ -74,192 +39,169 @@ static struct pthread main_thread;
  * between application locks and libc locks (threads holding the
  * latter can't be allowed to exit/terminate).
  */
-__weak_reference(_pthread_cond_init_stub,      _pthread_cond_init);
-__weak_reference(_pthread_cond_signal_stub,    _pthread_cond_signal);
-__weak_reference(_pthread_cond_wait_stub,      _pthread_cond_wait);
-__weak_reference(_pthread_getspecific_stub,    _pthread_getspecific);
-__weak_reference(_pthread_key_create_stub,     _pthread_key_create);
-__weak_reference(_pthread_key_delete_stub,     _pthread_key_delete);
-__weak_reference(_pthread_main_np_stub,                _pthread_main_np);
-__weak_reference(_pthread_mutex_destroy_stub,  _pthread_mutex_destroy);
-__weak_reference(_pthread_mutex_init_stub,     _pthread_mutex_init);
-__weak_reference(_pthread_mutex_lock_stub,     _pthread_mutex_lock);
-__weak_reference(_pthread_mutex_trylock_stub,  _pthread_mutex_trylock);
-__weak_reference(_pthread_mutex_unlock_stub,   _pthread_mutex_unlock);
-__weak_reference(_pthread_mutexattr_init_stub, _pthread_mutexattr_init);
-__weak_reference(_pthread_mutexattr_destroy_stub, _pthread_mutexattr_destroy);
-__weak_reference(_pthread_mutexattr_settype_stub, _pthread_mutexattr_settype);
-__weak_reference(_pthread_once_stub,           _pthread_once);
-__weak_reference(_pthread_self_stub,           _pthread_self);
-__weak_reference(_pthread_rwlock_init_stub,    _pthread_rwlock_init);
-__weak_reference(_pthread_rwlock_rdlock_stub,  _pthread_rwlock_rdlock);
-__weak_reference(_pthread_rwlock_tryrdlock_stub, _pthread_rwlock_tryrdlock);
-__weak_reference(_pthread_rwlock_trywrlock_stub, _pthread_rwlock_trywrlock);
-__weak_reference(_pthread_rwlock_unlock_stub,  _pthread_rwlock_unlock);
-__weak_reference(_pthread_rwlock_wrlock_stub,  _pthread_rwlock_wrlock);
-__weak_reference(_pthread_setspecific_stub,    _pthread_setspecific);
-__weak_reference(_pthread_sigmask_stub,                _pthread_sigmask);
-
-int
-_pthread_cond_init_stub(pthread_cond_t *cond __unused,
-                       const pthread_condattr_t *cond_attr __unused)
-{
-       return (0);
-}
-
-int
-_pthread_cond_signal_stub(pthread_cond_t *cond __unused)
-{
-       return (0);
-}
 
-int
-_pthread_cond_wait_stub(pthread_cond_t *cond __unused,
-                       pthread_mutex_t *mutex __unused)
-{
-       return (0);
-}
-
-void *
-_pthread_getspecific_stub(pthread_key_t key __unused)
+#define WR(f, n)                       \
+    __weak_reference(f, _ ## n);       \
+    __weak_reference(f, n)
+
+
+WR(stub_zero, pthread_atfork);
+WR(stub_zero, pthread_attr_destroy);
+WR(stub_zero, pthread_attr_get_np);
+WR(stub_zero, pthread_attr_getdetachstate);
+WR(stub_zero, pthread_attr_getguardsize);
+WR(stub_zero, pthread_attr_getinheritsched);
+WR(stub_zero, pthread_attr_getschedparam);
+WR(stub_zero, pthread_attr_getschedpolicy);
+WR(stub_zero, pthread_attr_getscope);
+WR(stub_zero, pthread_attr_getstack);
+WR(stub_zero, pthread_attr_getstackaddr);
+WR(stub_zero, pthread_attr_getstacksize);
+WR(stub_zero, pthread_attr_init);
+WR(stub_zero, pthread_attr_setcreatesuspend_np);
+WR(stub_zero, pthread_attr_setdetachstate);
+WR(stub_zero, pthread_attr_setguardsize);
+WR(stub_zero, pthread_attr_setinheritsched);
+WR(stub_zero, pthread_attr_setschedparam);
+WR(stub_zero, pthread_attr_setschedpolicy);
+WR(stub_zero, pthread_attr_setscope);
+WR(stub_zero, pthread_attr_setstack);
+WR(stub_zero, pthread_attr_setstackaddr);
+WR(stub_zero, pthread_attr_setstacksize);
+WR(stub_zero, pthread_barrier_destroy);
+WR(stub_zero, pthread_barrier_init);
+WR(stub_zero, pthread_barrier_wait);
+WR(stub_zero, pthread_barrierattr_destroy);
+WR(stub_zero, pthread_barrierattr_getpshared);
+WR(stub_zero, pthread_barrierattr_init);
+WR(stub_zero, pthread_barrierattr_setpshared);
+WR(stub_zero, pthread_cancel);
+WR(stub_zero, pthread_cleanup_pop);
+WR(stub_zero, pthread_cleanup_push);
+WR(stub_zero, pthread_cond_broadcast);
+WR(stub_zero, pthread_cond_destroy);
+WR(stub_zero, pthread_cond_init);
+WR(stub_zero, pthread_cond_signal);
+WR(stub_zero, pthread_cond_timedwait);
+WR(stub_zero, pthread_cond_wait);
+WR(stub_zero, pthread_condattr_destroy);
+WR(stub_zero, pthread_condattr_getclock);
+WR(stub_zero, pthread_condattr_getpshared);
+WR(stub_zero, pthread_condattr_init);
+WR(stub_zero, pthread_condattr_setclock);
+WR(stub_zero, pthread_condattr_setpshared);
+WR(stub_zero, pthread_detach);
+WR(stub_true, pthread_equal);
+WR(stub_exit, pthread_exit);
+WR(stub_zero, pthread_getconcurrency);
+WR(stub_zero, pthread_getprio);
+WR(stub_zero, pthread_getschedparam);
+WR(stub_null, pthread_getspecific);
+WR(stub_zero, pthread_join);
+WR(stub_zero, pthread_key_create);
+WR(stub_zero, pthread_key_delete);
+WR(stub_zero, pthread_kill);
+WR(stub_main, pthread_main_np);
+WR(stub_zero, pthread_multi_np);
+WR(stub_zero, pthread_mutex_destroy);
+WR(stub_zero, pthread_mutex_getprioceiling);
+WR(stub_zero, pthread_mutex_init);
+WR(stub_zero, pthread_mutex_lock);
+WR(stub_zero, pthread_mutex_setprioceiling);
+WR(stub_zero, pthread_mutex_timedlock);
+WR(stub_zero, pthread_mutex_trylock);
+WR(stub_zero, pthread_mutex_unlock);
+WR(stub_zero, pthread_mutexattr_destroy);
+WR(stub_zero, pthread_mutexattr_getkind_np);
+WR(stub_zero, pthread_mutexattr_getprioceiling);
+WR(stub_zero, pthread_mutexattr_getprotocol);
+WR(stub_zero, pthread_mutexattr_getpshared);
+WR(stub_zero, pthread_mutexattr_gettype);
+WR(stub_zero, pthread_mutexattr_init);
+WR(stub_zero, pthread_mutexattr_setkind_np);
+WR(stub_zero, pthread_mutexattr_setprioceiling);
+WR(stub_zero, pthread_mutexattr_setprotocol);
+WR(stub_zero, pthread_mutexattr_setpshared);
+WR(stub_zero, pthread_mutexattr_settype);
+WR(stub_zero, pthread_once);
+WR(stub_zero, pthread_resume_all_np);
+WR(stub_zero, pthread_resume_np);
+WR(stub_zero, pthread_rwlock_destroy);
+WR(stub_zero, pthread_rwlock_init);
+WR(stub_zero, pthread_rwlock_rdlock);
+WR(stub_zero, pthread_rwlock_timedrdlock);
+WR(stub_zero, pthread_rwlock_timedwrlock);
+WR(stub_zero, pthread_rwlock_tryrdlock);
+WR(stub_zero, pthread_rwlock_trywrlock);
+WR(stub_zero, pthread_rwlock_unlock);
+WR(stub_zero, pthread_rwlock_wrlock);
+WR(stub_zero, pthread_rwlockattr_destroy);
+WR(stub_zero, pthread_rwlockattr_getpshared);
+WR(stub_zero, pthread_rwlockattr_init);
+WR(stub_zero, pthread_rwlockattr_setpshared);
+WR(stub_self, pthread_self);
+WR(stub_zero, pthread_set_name_np);
+WR(stub_zero, pthread_setcancelstate);
+WR(stub_zero, pthread_setcanceltype);
+WR(stub_zero, pthread_setconcurrency);
+WR(stub_zero, pthread_setprio);
+WR(stub_zero, pthread_setschedparam);
+WR(stub_zero, pthread_setspecific);
+WR(stub_zero, pthread_sigmask);
+WR(stub_zero, pthread_single_np);
+WR(stub_zero, pthread_suspend_all_np);
+WR(stub_zero, pthread_suspend_np);
+WR(stub_zero, pthread_switch_add_np);
+WR(stub_zero, pthread_switch_delete_np);
+WR(stub_zero, pthread_testcancel);
+WR(stub_zero, pthread_timedjoin_np);
+WR(stub_zero, pthread_yield);
+WR(stub_zero, sched_yield);
+WR(stub_zero, sem_close);
+WR(stub_zero, sem_destroy);
+WR(stub_zero, sem_getvalue);
+WR(stub_zero, sem_init);
+WR(stub_zero, sem_open);
+WR(stub_zero, sem_post);
+WR(stub_zero, sem_trywait);
+WR(stub_zero, sem_unlink);
+WR(stub_zero, sem_wait);
+
+
+static int __used
+stub_zero(void)
+{
+       return (0);
+}
+
+static void * __used
+stub_null(void)
 {
        return (NULL);
 }
 
-int
-_pthread_key_create_stub(pthread_key_t *key __unused,
-                        void (*destructor) (void *) __unused)
+static void * __used
+stub_self(void)
 {
-       return (0);
-}
+       static struct {} main_thread;
 
-int
-_pthread_key_delete_stub(pthread_key_t key __unused)
-{
-       return (0);
+       return (&main_thread);
 }
 
-int
-_pthread_main_np_stub(void)
+static int __used
+stub_main(void)
 {
        return (-1);
 }
 
-int
-_pthread_mutex_destroy_stub(pthread_mutex_t *mattr __unused)
+static int __used
+stub_true(void)
 {
-       return (0);
-}
-
-int
-_pthread_mutex_init_stub(pthread_mutex_t *mutex __unused,
-                        const pthread_mutexattr_t *mattr __unused)
-{
-       return (0);
-}
-
-int
-_pthread_mutex_lock_stub(pthread_mutex_t *mutex __unused)
-{
-       return (0);
-}
-
-int
-_pthread_mutex_trylock_stub(pthread_mutex_t *mutex __unused)
-{
-       return (0);
-}
-
-int
-_pthread_mutex_unlock_stub(pthread_mutex_t *mutex __unused)
-{
-       return (0);
-}
-
-int
-_pthread_mutexattr_init_stub(pthread_mutexattr_t *mattr __unused)
-{
-       return (0);
-}
-
-int
-_pthread_mutexattr_destroy_stub(pthread_mutexattr_t *mattr __unused)
-{
-       return (0);
+       return (1);
 }
 
-int
-_pthread_mutexattr_settype_stub(pthread_mutexattr_t *mattr __unused,
-                               int type __unused)
+static void __used
+stub_exit(void)
 {
-       return (0);
-}
-
-int
-_pthread_once_stub(pthread_once_t *once_control __unused,
-                  void (*init_routine) (void) __unused)
-{
-       return (0);
-}
-
-int
-_pthread_rwlock_init_stub(pthread_rwlock_t *rwlock __unused,
-                         const pthread_rwlockattr_t *attr __unused)
-{
-       return (0);
-}
-
-int
-_pthread_rwlock_destroy_stub(pthread_rwlock_t *rwlock __unused)
-{
-       return (0);
-}
-
-int
-_pthread_rwlock_rdlock_stub(pthread_rwlock_t *rwlock __unused)
-{
-       return (0);
-}
-
-int
-_pthread_rwlock_tryrdlock_stub(pthread_rwlock_t *rwlock __unused)
-{
-       return (0);
-}
-
-int
-_pthread_rwlock_trywrlock_stub(pthread_rwlock_t *rwlock __unused)
-{
-       return (0);
-}
-
-int
-_pthread_rwlock_unlock_stub(pthread_rwlock_t *rwlock __unused)
-{
-       return (0);
-}
-
-int
-_pthread_rwlock_wrlock_stub(pthread_rwlock_t *rwlock __unused)
-{
-       return (0);
-}
-
-pthread_t
-_pthread_self_stub(void)
-{
-       return (&main_thread);
-}
-int
-_pthread_setspecific_stub(pthread_key_t key __unused,
-                         const void *value __unused)
-{
-       return (0);
-}
-
-int
-_pthread_sigmask_stub(int how __unused, const sigset_t *set __unused,
-                     sigset_t *oset __unused)
-{
-       return (0);
+       exit(0);
 }
diff --git a/lib/libc/gen/pthread_fake.c b/lib/libc/gen/pthread_fake.c
deleted file mode 100644 (file)
index 7b28929..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Copyright (c) 2004 The DragonFly Project.  All rights reserved.
- * 
- * This code is derived from software contributed to The DragonFly Project
- * by Simon Schubert <corecode@fs.ei.tum.de>
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- * 3. Neither the name of The DragonFly Project nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific, prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
- * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * 
- * $DragonFly: src/lib/libc/gen/pthread_fake.c,v 1.3 2008/05/25 21:34:49 hasso Exp $
- */
-
-#ifndef _THREAD_SAFE
-/*
- * Provide the functions for non-threaded programs using
- * thread-aware dynamic modules.
- *
- * This list explicitly lakes pthread_create, since an application
- * using this function clearly should be linked against -lc_r.
- * Leaving this function out allows the linker to catch this.
- * Same reason applies for thread-aware modules.
- */
-
-#include <sys/cdefs.h>
-
-#include <errno.h>
-#include <stddef.h>
-
-int     _pthread_fake_inval(void);
-void   *_pthread_fake_null(void);
-
-__weak_reference(_pthread_fake_inval, pthread_atfork);
-__weak_reference(_pthread_fake_inval, pthread_attr_destroy);
-__weak_reference(_pthread_fake_inval, pthread_attr_get_np);
-__weak_reference(_pthread_fake_inval, pthread_attr_getdetachstate);
-__weak_reference(_pthread_fake_inval, pthread_attr_getinheritsched);
-__weak_reference(_pthread_fake_inval, pthread_attr_getschedparam);
-__weak_reference(_pthread_fake_inval, pthread_attr_getschedpolicy);
-__weak_reference(_pthread_fake_inval, pthread_attr_getscope);
-__weak_reference(_pthread_fake_inval, pthread_attr_getstack);
-__weak_reference(_pthread_fake_inval, pthread_attr_getstackaddr);
-__weak_reference(_pthread_fake_inval, pthread_attr_getstacksize);
-__weak_reference(_pthread_fake_inval, pthread_attr_init);
-__weak_reference(_pthread_fake_inval, pthread_attr_setcreatesuspend_np);
-__weak_reference(_pthread_fake_inval, pthread_attr_setdetachstate);
-__weak_reference(_pthread_fake_inval, pthread_attr_setinheritsched);
-__weak_reference(_pthread_fake_inval, pthread_attr_setschedparam);
-__weak_reference(_pthread_fake_inval, pthread_attr_setschedpolicy);
-__weak_reference(_pthread_fake_inval, pthread_attr_setscope);
-__weak_reference(_pthread_fake_inval, pthread_attr_setstack);
-__weak_reference(_pthread_fake_inval, pthread_attr_setstackaddr);
-__weak_reference(_pthread_fake_inval, pthread_attr_setstacksize);
-__weak_reference(_pthread_fake_inval, pthread_cancel);
-__weak_reference(_pthread_fake_inval, pthread_setcancelstate);
-__weak_reference(_pthread_fake_inval, pthread_setcanceltype);
-__weak_reference(_pthread_fake_inval, pthread_testcancel);/*XXX void */
-__weak_reference(_pthread_fake_inval, pthread_cleanup_push);/*XXX void */
-__weak_reference(_pthread_fake_inval, pthread_cleanup_pop);/*XXX void */
-__weak_reference(_pthread_fake_inval, pthread_getconcurrency);
-__weak_reference(_pthread_fake_inval, pthread_setconcurrency);
-__weak_reference(_pthread_fake_inval, pthread_cond_init);
-__weak_reference(_pthread_fake_inval, pthread_cond_destroy);
-__weak_reference(_pthread_fake_inval, pthread_cond_wait);
-__weak_reference(_pthread_fake_inval, pthread_cond_timedwait);
-__weak_reference(_pthread_fake_inval, pthread_cond_signal);
-__weak_reference(_pthread_fake_inval, pthread_cond_broadcast);
-__weak_reference(_pthread_fake_inval, pthread_condattr_destroy);
-__weak_reference(_pthread_fake_inval, pthread_condattr_init);
-__weak_reference(_pthread_fake_inval, pthread_detach);
-__weak_reference(_pthread_fake_inval, pthread_equal);/*XXX*/
-__weak_reference(_pthread_fake_inval, pthread_exit);/*XXX void*/
-__weak_reference(_pthread_fake_inval, pthread_getprio);
-__weak_reference(_pthread_fake_inval, pthread_getschedparam);
-__weak_reference(_pthread_fake_inval, pthread_set_name_np);/*XXX void*/
-__weak_reference(_pthread_fake_inval, pthread_join);
-__weak_reference(_pthread_fake_inval, pthread_kill);
-__weak_reference(_pthread_fake_inval, pthread_main_np);
-__weak_reference(_pthread_fake_inval, pthread_mutexattr_init);
-__weak_reference(_pthread_fake_inval, pthread_mutexattr_setkind_np);
-__weak_reference(_pthread_fake_inval, pthread_mutexattr_getkind_np);
-__weak_reference(_pthread_fake_inval, pthread_mutexattr_gettype);
-__weak_reference(_pthread_fake_inval, pthread_mutexattr_settype);
-__weak_reference(_pthread_fake_inval, pthread_multi_np);
-__weak_reference(_pthread_fake_inval, pthread_mutex_init);
-__weak_reference(_pthread_fake_inval, pthread_mutex_destroy);
-__weak_reference(_pthread_fake_inval, pthread_mutex_trylock);
-__weak_reference(_pthread_fake_inval, pthread_mutex_lock);
-__weak_reference(_pthread_fake_inval, pthread_mutex_unlock);
-__weak_reference(_pthread_fake_inval, pthread_mutexattr_getprioceiling);
-__weak_reference(_pthread_fake_inval, pthread_mutexattr_setprioceiling);
-__weak_reference(_pthread_fake_inval, pthread_mutex_getprioceiling);
-__weak_reference(_pthread_fake_inval, pthread_mutex_setprioceiling);
-__weak_reference(_pthread_fake_inval, pthread_mutexattr_getprotocol);
-__weak_reference(_pthread_fake_inval, pthread_mutexattr_setprotocol);
-__weak_reference(_pthread_fake_inval, pthread_mutexattr_destroy);
-__weak_reference(_pthread_fake_inval, pthread_once);
-__weak_reference(_pthread_fake_inval, pthread_resume_np);
-__weak_reference(_pthread_fake_inval, pthread_resume_all_np);/*XXX void*/
-__weak_reference(_pthread_fake_inval, pthread_rwlock_destroy);
-__weak_reference(_pthread_fake_inval, pthread_rwlock_init);
-__weak_reference(_pthread_fake_inval, pthread_rwlock_rdlock);
-__weak_reference(_pthread_fake_inval, pthread_rwlock_tryrdlock);
-__weak_reference(_pthread_fake_inval, pthread_rwlock_trywrlock);
-__weak_reference(_pthread_fake_inval, pthread_rwlock_unlock);
-__weak_reference(_pthread_fake_inval, pthread_rwlock_wrlock);
-__weak_reference(_pthread_fake_inval, pthread_rwlockattr_destroy);
-__weak_reference(_pthread_fake_inval, pthread_rwlockattr_getpshared);
-__weak_reference(_pthread_fake_inval, pthread_rwlockattr_init);
-__weak_reference(_pthread_fake_inval, pthread_rwlockattr_setpshared);
-__weak_reference(_pthread_fake_null, pthread_self);/*XXX pthread_t */
-__weak_reference(_pthread_fake_inval, sem_init);
-__weak_reference(_pthread_fake_inval, sem_destroy);
-__weak_reference(_pthread_fake_inval, sem_open);
-__weak_reference(_pthread_fake_inval, sem_close);
-__weak_reference(_pthread_fake_inval, sem_unlink);
-__weak_reference(_pthread_fake_inval, sem_wait);
-__weak_reference(_pthread_fake_inval, sem_trywait);
-__weak_reference(_pthread_fake_inval, sem_post);
-__weak_reference(_pthread_fake_inval, sem_getvalue);
-__weak_reference(_pthread_fake_inval, pthread_setprio);
-__weak_reference(_pthread_fake_inval, pthread_setschedparam);
-__weak_reference(_pthread_fake_inval, pthread_sigmask);
-__weak_reference(_pthread_fake_inval, pthread_single_np);
-__weak_reference(_pthread_fake_inval, pthread_key_create);
-__weak_reference(_pthread_fake_inval, pthread_key_delete);
-__weak_reference(_pthread_fake_inval, pthread_getspecific);
-__weak_reference(_pthread_fake_inval, pthread_setspecific);
-__weak_reference(_pthread_fake_inval, pthread_suspend_np);
-__weak_reference(_pthread_fake_inval, pthread_suspend_all_np);/*XXX void*/
-__weak_reference(_pthread_fake_inval, pthread_switch_add_np);
-__weak_reference(_pthread_fake_inval, pthread_switch_delete_np);
-__weak_reference(_pthread_fake_inval, sched_yield);
-__weak_reference(_pthread_fake_inval, pthread_yield);/*XXX void*/
-
-int
-_pthread_fake_inval(void)
-{
-       return EINVAL;
-}
-
-void *
-_pthread_fake_null(void)
-{
-       return NULL;
-}
-
-#endif /* _THREAD_SAFE */