2 * Acess2 libnative (Kernel Simulation Library)
3 * - By John Hodge (thePowersGang)
6 * - Weakly linked copies of pthread_* and sem_*
8 #ifndef _PTHREAD_WEAK_H
9 #define _PTHREAD_WEAK_H
11 #include <semaphore.h>
13 extern int pthread_create (pthread_t*, const pthread_attr_t*, void* (*)(void*), void*) __attribute__ ((weak));
14 extern int pthread_mutex_init (pthread_mutex_t*, const pthread_mutexattr_t*) __attribute__ ((weak));
15 extern int pthread_mutex_lock (pthread_mutex_t*) __attribute__ ((weak));
16 extern int pthread_mutex_unlock (pthread_mutex_t*) __attribute__ ((weak));
17 extern int pthread_mutex_destroy (pthread_mutex_t*) __attribute__ ((weak));
19 extern int sem_init(sem_t *sem, int pshared, unsigned int value) __attribute__ ((weak));
20 extern int sem_wait(sem_t *sem) __attribute__ ((weak));
21 extern int sem_trywait(sem_t *sem) __attribute__ ((weak));
22 extern int sem_post(sem_t *sem) __attribute__ ((weak));
23 extern int sem_getvalue(sem_t *sem, int *sval) __attribute__ ((weak));