summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2006-01-26 22:30:50 +0000
committerPeter S. Mazinger <ps.m@gmx.net>2006-01-26 22:30:50 +0000
commitdfb199421b130157ef9154acb932d80b35fa2894 (patch)
treebf16be20c6ffb3cb09b889c036cc7085e3146ed3
parent1466eb283c8eee992835f66433c43fd4d31e92bc (diff)
prototypes for threads too
-rw-r--r--libpthread/linuxthreads.old/lockfile.c4
-rw-r--r--libpthread/linuxthreads.old/mutex.c7
-rw-r--r--libpthread/linuxthreads.old/oldsemaphore.c6
-rw-r--r--libpthread/linuxthreads.old/ptfork.c3
-rw-r--r--libpthread/linuxthreads.old/pthread.c2
-rw-r--r--libpthread/linuxthreads.old/semaphore.c6
6 files changed, 25 insertions, 3 deletions
diff --git a/libpthread/linuxthreads.old/lockfile.c b/libpthread/linuxthreads.old/lockfile.c
index 453a7e936..d054b62cb 100644
--- a/libpthread/linuxthreads.old/lockfile.c
+++ b/libpthread/linuxthreads.old/lockfile.c
@@ -27,8 +27,8 @@ extern __typeof(pthread_mutexattr_destroy) __pthread_mutexattr_destroy attribute
/* Note: glibc puts flockfile, funlockfile, and ftrylockfile in both
* libc and libpthread. In uClibc, they are now in libc only. */
-void
-__fresetlockfiles (void)
+void __fresetlockfiles (void);
+void __fresetlockfiles (void)
{
FILE *fp;
pthread_mutexattr_t attr;
diff --git a/libpthread/linuxthreads.old/mutex.c b/libpthread/linuxthreads.old/mutex.c
index 8d26b8a87..890841452 100644
--- a/libpthread/linuxthreads.old/mutex.c
+++ b/libpthread/linuxthreads.old/mutex.c
@@ -225,6 +225,7 @@ strong_alias(__pthread_mutexattr_settype,pthread_mutexattr_settype)
strong_alias (__pthread_mutexattr_settype, __pthread_mutexattr_setkind_np)
weak_alias (__pthread_mutexattr_setkind_np, pthread_mutexattr_setkind_np)
+int __pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *kind) attribute_hidden;
int __pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *kind)
{
*kind = attr->__mutexkind;
@@ -235,6 +236,8 @@ strong_alias (__pthread_mutexattr_gettype, __pthread_mutexattr_getkind_np)
weak_alias (__pthread_mutexattr_getkind_np, pthread_mutexattr_getkind_np)
int __pthread_mutexattr_getpshared (const pthread_mutexattr_t *attr attribute_unused,
+ int *pshared) attribute_hidden;
+int __pthread_mutexattr_getpshared (const pthread_mutexattr_t *attr attribute_unused,
int *pshared)
{
*pshared = PTHREAD_PROCESS_PRIVATE;
@@ -242,6 +245,7 @@ int __pthread_mutexattr_getpshared (const pthread_mutexattr_t *attr attribute_un
}
weak_alias (__pthread_mutexattr_getpshared, pthread_mutexattr_getpshared)
+int __pthread_mutexattr_setpshared (pthread_mutexattr_t *attr attribute_unused, int pshared) attribute_hidden;
int __pthread_mutexattr_setpshared (pthread_mutexattr_t *attr attribute_unused, int pshared)
{
if (pshared != PTHREAD_PROCESS_PRIVATE && pshared != PTHREAD_PROCESS_SHARED)
@@ -334,16 +338,19 @@ strong_alias (__pthread_once, pthread_once)
* and reset them back to NEVER.
*/
+void __pthread_once_fork_prepare(void);
void __pthread_once_fork_prepare(void)
{
__pthread_mutex_lock(&once_masterlock);
}
+void __pthread_once_fork_parent(void);
void __pthread_once_fork_parent(void)
{
__pthread_mutex_unlock(&once_masterlock);
}
+void __pthread_once_fork_child(void);
void __pthread_once_fork_child(void)
{
__pthread_mutex_init(&once_masterlock, NULL);
diff --git a/libpthread/linuxthreads.old/oldsemaphore.c b/libpthread/linuxthreads.old/oldsemaphore.c
index 6817e8e7c..6e91dc3c7 100644
--- a/libpthread/linuxthreads.old/oldsemaphore.c
+++ b/libpthread/linuxthreads.old/oldsemaphore.c
@@ -53,6 +53,7 @@ static inline int sem_compare_and_swap(old_sem_t *sem, long oldval, long newval)
static void sem_restart_list(pthread_descr waiting);
+int __old_sem_init(old_sem_t *sem, int pshared, unsigned int value);
int __old_sem_init(old_sem_t *sem, int pshared, unsigned int value)
{
if (value > SEM_VALUE_MAX) {
@@ -77,6 +78,7 @@ static int old_sem_extricate_func(void *obj attribute_unused, pthread_descr th a
return 1;
}
+int __old_sem_wait(old_sem_t * sem);
int __old_sem_wait(old_sem_t * sem)
{
long oldstatus, newstatus;
@@ -139,6 +141,7 @@ int __old_sem_wait(old_sem_t * sem)
}
}
+int __old_sem_trywait(old_sem_t * sem);
int __old_sem_trywait(old_sem_t * sem)
{
long oldstatus, newstatus;
@@ -155,6 +158,7 @@ int __old_sem_trywait(old_sem_t * sem)
return 0;
}
+int __old_sem_post(old_sem_t * sem);
int __old_sem_post(old_sem_t * sem)
{
long oldstatus, newstatus;
@@ -178,6 +182,7 @@ int __old_sem_post(old_sem_t * sem)
return 0;
}
+int __old_sem_getvalue(old_sem_t * sem, int * sval);
int __old_sem_getvalue(old_sem_t * sem, int * sval)
{
long status = sem->sem_status;
@@ -188,6 +193,7 @@ int __old_sem_getvalue(old_sem_t * sem, int * sval)
return 0;
}
+int __old_sem_destroy(old_sem_t * sem);
int __old_sem_destroy(old_sem_t * sem)
{
if ((sem->sem_status & 1) == 0) {
diff --git a/libpthread/linuxthreads.old/ptfork.c b/libpthread/linuxthreads.old/ptfork.c
index 38fb60e9d..2ecab8884 100644
--- a/libpthread/linuxthreads.old/ptfork.c
+++ b/libpthread/linuxthreads.old/ptfork.c
@@ -80,7 +80,8 @@ static inline void pthread_call_handlers(struct handler_list * list)
extern __typeof(fork) __libc_fork;
-pid_t attribute_hidden __fork(void)
+pid_t __fork(void) attribute_hidden;
+pid_t __fork(void)
{
pid_t pid;
struct handler_list * prepare, * child, * parent;
diff --git a/libpthread/linuxthreads.old/pthread.c b/libpthread/linuxthreads.old/pthread.c
index 1cd25ed4e..a4220f5a5 100644
--- a/libpthread/linuxthreads.old/pthread.c
+++ b/libpthread/linuxthreads.old/pthread.c
@@ -265,6 +265,7 @@ int __libc_current_sigrtmax (void)
/* Allocate real-time signal with highest/lowest available
priority. Please note that we don't use a lock since we assume
this function to be called at program start. */
+int __libc_allocate_rtsig (int high);
int __libc_allocate_rtsig (int high)
{
if (current_rtmin == -1 || current_rtmin > current_rtmax)
@@ -459,6 +460,7 @@ static void pthread_initialize(void)
on_exit(pthread_onexit_process, NULL);
}
+void __pthread_initialize(void);
void __pthread_initialize(void)
{
pthread_initialize();
diff --git a/libpthread/linuxthreads.old/semaphore.c b/libpthread/linuxthreads.old/semaphore.c
index 10b609c4a..a44f52411 100644
--- a/libpthread/linuxthreads.old/semaphore.c
+++ b/libpthread/linuxthreads.old/semaphore.c
@@ -23,6 +23,7 @@
#include "restart.h"
#include "queue.h"
+int __new_sem_init(sem_t *sem, int pshared, unsigned int value);
int __new_sem_init(sem_t *sem, int pshared, unsigned int value)
{
if (value > SEM_VALUE_MAX) {
@@ -55,6 +56,7 @@ static int new_sem_extricate_func(void *obj, pthread_descr th)
return did_remove;
}
+int __new_sem_wait(sem_t * sem);
int __new_sem_wait(sem_t * sem)
{
volatile pthread_descr self = thread_self();
@@ -117,6 +119,7 @@ int __new_sem_wait(sem_t * sem)
return 0;
}
+int __new_sem_trywait(sem_t * sem);
int __new_sem_trywait(sem_t * sem)
{
int retval;
@@ -133,6 +136,7 @@ int __new_sem_trywait(sem_t * sem)
return retval;
}
+int __new_sem_post(sem_t * sem);
int __new_sem_post(sem_t * sem)
{
pthread_descr self = thread_self();
@@ -174,12 +178,14 @@ int __new_sem_post(sem_t * sem)
return 0;
}
+int __new_sem_getvalue(sem_t * sem, int * sval);
int __new_sem_getvalue(sem_t * sem, int * sval)
{
*sval = sem->__sem_value;
return 0;
}
+int __new_sem_destroy(sem_t * sem);
int __new_sem_destroy(sem_t * sem)
{
if (sem->__sem_waiting != NULL) {