Update.
authorAndreas Jaeger <aj@suse.de>
Wed, 27 Dec 2000 17:18:07 +0000 (17:18 +0000)
committerAndreas Jaeger <aj@suse.de>
Wed, 27 Dec 2000 17:18:07 +0000 (17:18 +0000)
* include/sys/wait.h: Add some prototypes.
* Rules (dummy.c): Create also prototype to shut up GCC.

2000-12-27  Andreas Jaeger  <aj@suse.de>

27 files changed:
ChangeLog
Rules
include/sys/wait.h
linuxthreads/ChangeLog
linuxthreads/events.c
linuxthreads/internals.h
linuxthreads/lockfile.c
linuxthreads/mutex.c
linuxthreads/oldsemaphore.c
linuxthreads/pt-machine.c
linuxthreads/ptfork.c
linuxthreads/rwlock.c
linuxthreads/specific.c
linuxthreads/sysdeps/alpha/pspinlock.c
linuxthreads/sysdeps/arm/pspinlock.c
linuxthreads/sysdeps/hppa/pspinlock.c
linuxthreads/sysdeps/i386/pspinlock.c
linuxthreads/sysdeps/ia64/pspinlock.c
linuxthreads/sysdeps/m68k/pspinlock.c
linuxthreads/sysdeps/mips/pspinlock.c
linuxthreads/sysdeps/powerpc/pspinlock.c
linuxthreads/sysdeps/s390/pspinlock.c
linuxthreads/sysdeps/sh/pspinlock.c
linuxthreads/sysdeps/sparc/sparc32/pspinlock.c
linuxthreads/sysdeps/sparc/sparc32/sparcv9/pspinlock.c
linuxthreads/sysdeps/sparc/sparc64/pspinlock.c
linuxthreads/weaks.c

index bdec950..b203865 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2000-12-27  Andreas Jaeger  <aj@suse.de>
 
+       * include/sys/wait.h: Add some prototypes.
+       * Rules (dummy.c): Create also prototype to shut up GCC.
+
+2000-12-27  Andreas Jaeger  <aj@suse.de>
+
        * sysdeps/mach/hurd/if_index.c (__protocol_available): Uncomment,
        it's not needed at the moment.
        * sysdeps/generic/if_index.c (__protocol_available): Likewise.
diff --git a/Rules b/Rules
index 956a2eb..464495e 100644 (file)
--- a/Rules
+++ b/Rules
@@ -74,7 +74,8 @@ endef
 
 $(common-objpfx)dummy.c:
        rm -f $@
-       echo 'void __dummy__ (void) { }' > $@
+       (echo 'extern void __dummy__ (void);'; \
+        echo 'void __dummy__ (void) { }') > $@
 common-generated += dummy.o dummy.c
 \f
 # This makes all the auxiliary and test programs.
index 9244c30..37873df 100644 (file)
@@ -4,6 +4,8 @@
 /* Now define the internal interfaces.  */
 extern __pid_t __waitpid (__pid_t __pid, int *__stat_loc,
                          int __options);
+extern __pid_t __libc_waitpid (pid_t __pid, int *__stat_loc, int __options);
+extern __pid_t __libc_wait (int *__stat_loc);
 extern __pid_t __wait3 (__WAIT_STATUS __stat_loc,
                        int __options, struct rusage * __usage);
 extern __pid_t __wait4 (__pid_t __pid, __WAIT_STATUS __stat_loc,
index e05e7c0..e7b3819 100644 (file)
@@ -1,3 +1,45 @@
+2000-12-27  Andreas Jaeger  <aj@suse.de>
+
+       * Examples/ex13.c: Make local functions static.
+       * ecmutex.c: Likewise.
+       * Examples/ex14.c: Likewise.
+
+       * Examples/ex2.c: Make local functions static; reformat.
+       * Examples/ex1.c: Likewise.
+       * Examples/ex4.c: Likewise.
+       * Examples/ex5.c: Likewise.
+       * Examples/ex7.c: Likewise.
+
+       * oldsemaphore.c: Add prototypes to shut up GCC.
+       * pt-machine.c: Likewise.
+
+       * weaks.c: Add prototype for pthread_exit.
+
+       * internals.h: Add some prototypes, format prototypes and add
+       missing externs.
+       Move __libc_waitpid prototype to include/sys/wait.h.
+
+       * rwlock.c: Include <bits/libc-lock.h> for prototypes.
+       * mutex.c: Likewise.
+       * specific.c: Likewise.
+       * ptfork.c: Likewise.
+
+       * lockfile.c: Include internals.h to get prototypes.
+       * events.c: Likewise.
+       * sysdeps/alpha/pspinlock.c: Likewise.
+       * sysdeps/arm/pspinlock.c: Likewise.
+       * sysdeps/hppa/pspinlock.c: Likewise.
+       * sysdeps/i386/pspinlock.c: Likewise.
+       * sysdeps/ia64/pspinlock.c: Likewise.
+       * sysdeps/m68k/pspinlock.c: Likewise.
+       * sysdeps/mips/pspinlock.c: Likewise.
+       * sysdeps/powerpc/pspinlock.c: Likewise.
+       * sysdeps/s390/pspinlock.c: Likewise.
+       * sysdeps/sh/pspinlock.c: Likewise.
+       * sysdeps/sparc/sparc32/pspinlock.c: Likewise.
+       * sysdeps/sparc/sparc32/sparcv9/pspinlock.c: Likewise.
+       * sysdeps/sparc/sparc64/pspinlock.c: Likewise.
+
 2000-12-27  Ulrich Drepper  <drepper@redhat.com>
 
        * attr.c (__pthread_attr_setstack): Fix setting of __stackaddr element.
index e5be3d9..c65bafc 100644 (file)
@@ -1,5 +1,5 @@
 /* Event functions used while debugging.
-   Copyright (C) 1999 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,8 @@
 
 /* The functions contained here do nothing, they just return.  */
 
+#include "internals.h"
+
 void
 __linuxthreads_create_event (void)
 {
index b81e5f4..9480530 100644 (file)
@@ -427,21 +427,22 @@ static inline pthread_descr thread_self (void)
 
 /* Internal global functions */
 
-void __pthread_destroy_specifics(void);
-void __pthread_perform_cleanup(void);
-int __pthread_initialize_manager(void);
-void __pthread_message(char * fmt, ...);
-int __pthread_manager(void *reqfd);
-int __pthread_manager_event(void *reqfd);
-void __pthread_manager_sighandler(int sig);
-void __pthread_reset_main_thread(void);
-void __pthread_once_fork_prepare(void);
-void __pthread_once_fork_parent(void);
-void __pthread_once_fork_child(void);
-void __flockfilelist(void);
-void __funlockfilelist(void);
-void __fresetlockfiles(void);
-void __pthread_manager_adjust_prio(int thread_prio);
+extern void __pthread_destroy_specifics (void);
+extern void __pthread_perform_cleanup (void);
+extern int __pthread_initialize_manager (void);
+extern void __pthread_message (char * fmt, ...);
+extern int __pthread_manager (void *reqfd);
+extern int __pthread_manager_event (void *reqfd);
+extern void __pthread_manager_sighandler (int sig);
+extern void __pthread_reset_main_thread (void);
+extern void __pthread_once_fork_prepare (void);
+extern void __pthread_once_fork_parent (void);
+extern void __pthread_once_fork_child (void);
+extern void __flockfilelist (void);
+extern void __funlockfilelist (void);
+extern void __fresetlockfiles (void);
+extern void __pthread_manager_adjust_prio (int thread_prio);
+extern void __pthread_initialize_minimal (void);
 
 extern int __pthread_attr_setguardsize (pthread_attr_t *__attr,
                                        size_t __guardsize);
@@ -455,23 +456,52 @@ extern int __pthread_attr_setstacksize (pthread_attr_t *__attr,
                                        size_t __stacksize);
 extern int __pthread_attr_getstacksize (const pthread_attr_t *__attr,
                                        size_t *__stacksize);
+extern int __pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
+                                   size_t __stacksize);
+extern int __pthread_attr_getstack (const pthread_attr_t *__attr, void **__stackaddr,
+                                   size_t *__stacksize);
 extern int __pthread_getconcurrency (void);
 extern int __pthread_setconcurrency (int __level);
+extern int __pthread_mutex_timedlock (pthread_mutex_t *__mutex,
+                                     const struct timespec *__abstime);
+extern int __pthread_mutexattr_getpshared (const pthread_mutexattr_t *__attr,
+                                          int *__pshared);
+extern int __pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr,
+                                          int __pshared);
 extern int __pthread_mutexattr_gettype (const pthread_mutexattr_t *__attr,
                                        int *__kind);
 extern void __pthread_kill_other_threads_np (void);
 
-void __pthread_restart_old(pthread_descr th);
-void __pthread_suspend_old(pthread_descr self);
-int __pthread_timedsuspend_old(pthread_descr self, const struct timespec *abs);
+extern void __pthread_restart_old(pthread_descr th);
+extern void __pthread_suspend_old(pthread_descr self);
+extern int __pthread_timedsuspend_old(pthread_descr self, const struct timespec *abs);
 
-void __pthread_restart_new(pthread_descr th);
-void __pthread_suspend_new(pthread_descr self);
-int __pthread_timedsuspend_new(pthread_descr self, const struct timespec *abs);
+extern void __pthread_restart_new(pthread_descr th);
+extern void __pthread_suspend_new(pthread_descr self);
+extern int __pthread_timedsuspend_new(pthread_descr self, const struct timespec *abs);
 
-void __pthread_wait_for_restart_signal(pthread_descr self);
+extern void __pthread_wait_for_restart_signal(pthread_descr self);
+
+extern int __pthread_yield (void);
+
+extern int __pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
+                                        __const struct timespec *__restrict
+                                        __abstime);
+extern int __pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
+                                        __const struct timespec *__restrict
+                                        __abstime);
+extern int __pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr);
+
+extern int __pthread_barrierattr_getpshared (__const pthread_barrierattr_t *
+                                            __restrict __attr,
+                                            int *__restrict __pshared);
+
+extern int __pthread_spin_lock (pthread_spinlock_t *__lock);
+extern int __pthread_spin_trylock (pthread_spinlock_t *__lock);
+extern int __pthread_spin_unlock (pthread_spinlock_t *__lock);
+extern int __pthread_spin_init (pthread_spinlock_t *__lock, int __pshared);
+extern int __pthread_spin_destroy (pthread_spinlock_t *__lock);
 
-int __pthread_yield (void);
 
 /* Global pointers to old or new suspend functions */
 
@@ -484,10 +514,25 @@ extern int (*__pthread_timedsuspend)(pthread_descr, const struct timespec *);
 extern int __libc_close (int fd);
 extern int __libc_nanosleep (const struct timespec *requested_time,
                             struct timespec *remaining);
-extern pid_t __libc_waitpid (pid_t pid, int *stat_loc, int options);
-
 /* Prototypes for some of the new semaphore functions.  */
 extern int __new_sem_post (sem_t * sem);
+extern int __new_sem_init (sem_t *__sem, int __pshared, unsigned int __value);
+extern int __new_sem_wait (sem_t *__sem);
+extern int __new_sem_trywait (sem_t *__sem);
+extern int __new_sem_getvalue (sem_t *__restrict __sem, int *__restrict __sval);
+extern int __new_sem_destroy (sem_t *__sem);
+
+/* Prototypes for compatibility functions.  */
+extern int __pthread_attr_init_2_1 (pthread_attr_t *__attr);
+extern int __pthread_attr_init_2_0 (pthread_attr_t *__attr);
+extern int __pthread_create_2_1 (pthread_t *__restrict __thread,
+                                const pthread_attr_t *__attr,
+                                void *(*__start_routine) (void *),
+                                void *__restrict __arg);
+extern int __pthread_create_2_0 (pthread_t *__restrict thread,
+                                const pthread_attr_t *__attr,
+                                void *(*__start_routine) (void *),
+                                void *__restrict arg);
 
 /* The functions called the signal events.  */
 extern void __linuxthreads_create_event (void);
index 0ef02f8..38fa3fb 100644 (file)
@@ -20,6 +20,7 @@
 #include <bits/libc-lock.h>
 #include <stdio.h>
 #include <pthread.h>
+#include "internals.h"
 
 #ifdef USE_IN_LIBIO
 #include "../libio/libioP.h"
index 5955c57..3ad2794 100644 (file)
@@ -14,6 +14,7 @@
 
 /* Mutexes */
 
+#include <bits/libc-lock.h>
 #include <errno.h>
 #include <sched.h>
 #include <stddef.h>
index b9eb20f..82cd637 100644 (file)
@@ -34,6 +34,14 @@ typedef struct {
     int sem_spinlock;
 } old_sem_t;
 
+extern int __old_sem_init (old_sem_t *__sem, int __pshared, unsigned int __value);
+extern int __old_sem_wait (old_sem_t *__sem);
+extern int __old_sem_trywait (old_sem_t *__sem);
+extern int __old_sem_post (old_sem_t *__sem);
+extern int __old_sem_getvalue (old_sem_t *__sem, int *__sval);
+extern int __old_sem_destroy (old_sem_t *__sem);
+
+
 /* Maximum value the semaphore can have.  */
 #define SEM_VALUE_MAX   ((int) ((~0u) >> 1))
 
index 438008d..f6298c4 100644 (file)
@@ -19,4 +19,7 @@
 
 #define PT_EI
 
+extern long int testandset (int *spinlock);
+extern int __compare_and_swap (long int *p, long int oldval, long int newval);
+
 #include <pt-machine.h>
index deb347f..564f8d7 100644 (file)
@@ -20,6 +20,7 @@
 #include <unistd.h>
 #include "pthread.h"
 #include "internals.h"
+#include <bits/libc-lock.h>
 
 struct handler_list {
   void (*handler)(void);
index 635f465..6af57cd 100644 (file)
@@ -19,6 +19,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <bits/libc-lock.h>
 #include <errno.h>
 #include <pthread.h>
 #include <stdlib.h>
index 10697af..a7fa8ff 100644 (file)
@@ -20,6 +20,8 @@
 #include "pthread.h"
 #include "internals.h"
 #include "spinlock.h"
+#include <bits/libc-lock.h>
+
 
 /* Table of keys. */
 
index 0d871b4..574c638 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <errno.h>
 #include <pthread.h>
+#include "internals.h"
 
 
 /* This implementation is similar to the one used in the Linux kernel.
index a56881a..010ad33 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <errno.h>
 #include <pthread.h>
+#include "internals.h"
 
 
 int
index 1b1511f..6a858bf 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <errno.h>
 #include <pthread.h>
-
+#include "internals.h"
 
 int
 __pthread_spin_lock (pthread_spinlock_t *lock)
index 426e63a..5d24238 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <errno.h>
 #include <pthread.h>
-
+#include "internals.h"
 
 /* This implementation is similar to the one used in the Linux kernel.
    But the kernel is byte instructions for the memory access.  This is
index ada28bd..174e38d 100644 (file)
@@ -20,7 +20,7 @@
 
 #include <errno.h>
 #include <pthread.h>
-
+#include "internals.h"
 
 /* This implementation is inspired by the implementation used in the
    Linux kernel. */
index 994adc8..38e490f 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <errno.h>
 #include <pthread.h>
+#include "internals.h"
 
 
 int
index 7df3040..ab73d1d 100644 (file)
@@ -21,7 +21,7 @@
 #include <pthread.h>
 #include <sgidefs.h>
 #include <sys/tas.h>
-
+#include "internals.h"
 
 #if (_MIPS_ISA >= _MIPS_ISA_MIPS2)
 
index 77cad0c..80e2727 100644 (file)
@@ -20,7 +20,7 @@
 #include <errno.h>
 #include <pthread.h>
 #include <pt-machine.h>
-
+#include "internals.h"
 
 int
 __pthread_spin_lock (pthread_spinlock_t *lock)
index 08231bf..eeca51f 100644 (file)
@@ -20,7 +20,7 @@
 
 #include <errno.h>
 #include <pthread.h>
-
+#include "internals.h"
 
 /* This implementation is similar to the one used in the Linux kernel.
    But the kernel is byte instructions for the memory access.  This is
index be9fc80..2da3bc4 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <errno.h>
 #include <pthread.h>
-
+#include "internals.h"
 
 int
 __pthread_spin_lock (pthread_spinlock_t *lock)
index 1788d7a..be11817 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <errno.h>
 #include <pthread.h>
-
+#include "internals.h"
 
 /* This implementation is similar to the one used in the Linux kernel.  */
 int
index 99ffdc0..a762650 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <errno.h>
 #include <pthread.h>
+#include "internals.h"
 
 
 /* This implementation is similar to the one used in the Linux kernel.  */
index 1b7fa15..2106e44 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <errno.h>
 #include <pthread.h>
-
+#include "internals.h"
 
 /* This implementation is similar to the one used in the Linux kernel.  */
 int
index 163f232..948b893 100644 (file)
@@ -26,6 +26,7 @@
 extern int __pthread_return_0 (void);
 extern int __pthread_return_1 (void);
 extern void __pthread_return_void (void);
+extern void weak_function pthread_exit (void *__retval);
 
 /* Those are pthread functions which return 0 if successful. */
 weak_alias (__pthread_return_0, BP_SYM (__libc_pthread_attr_init_2_1))