summaryrefslogtreecommitdiffstats
path: root/libpthread/nptl/sysdeps/pthread
diff options
context:
space:
mode:
Diffstat (limited to 'libpthread/nptl/sysdeps/pthread')
-rw-r--r--libpthread/nptl/sysdeps/pthread/Makefile.in26
-rw-r--r--libpthread/nptl/sysdeps/pthread/pt-longjmp.c29
-rw-r--r--libpthread/nptl/sysdeps/pthread/pthread_once.c54
-rw-r--r--libpthread/nptl/sysdeps/pthread/sigaction.c (renamed from libpthread/nptl/sysdeps/pthread/pt-sigaction.c)0
-rw-r--r--libpthread/nptl/sysdeps/pthread/sigfillset.c (renamed from libpthread/nptl/sysdeps/pthread/pt-sigfillset.c)0
-rw-r--r--libpthread/nptl/sysdeps/pthread/sigprocmask.c (renamed from libpthread/nptl/sysdeps/pthread/pt-sigprocmask.c)0
6 files changed, 107 insertions, 2 deletions
diff --git a/libpthread/nptl/sysdeps/pthread/Makefile.in b/libpthread/nptl/sysdeps/pthread/Makefile.in
index 05ca42e0c..a3043d5e2 100644
--- a/libpthread/nptl/sysdeps/pthread/Makefile.in
+++ b/libpthread/nptl/sysdeps/pthread/Makefile.in
@@ -18,7 +18,18 @@ libpthread_CSRC = pthread_barrier_wait.c pthread_cond_broadcast.c \
pthread_rwlock_wrlock.c pthread_sigmask.c \
pthread_spin_destroy.c pthread_spin_init.c \
pthread_spin_unlock.c pt-sigaction.c pt-sigfillset.c \
- pt-sigprocmask.c unwind-forcedunwind.c
+ pt-sigprocmask.c unwind-forcedunwind.c pt-longjmp.c
+
+ifeq ($(TARGET_ARCH),i386)
+libpthread_CSRC += pthread_once.c
+endif
+ifeq ($(TARGET_ARCH),sh)
+libpthread_CSRC += pthread_once.c
+endif
+ifeq ($(TARGET_ARCH),x86_64)
+libpthread_CSRC += pthread_once.c
+endif
+
CFLAGS-pt-common = -DNOT_IN_libc=1 $(SSP_ALL_CFLAGS)
@@ -92,7 +103,18 @@ $(pthread_OUT)/crtn.S: $(pthread_OUT)/pt-initfini.s
-e '/@TRAILER_BEGINS/,$$p' $< > $@
endif
+$(pthread_DIR)/pt-sigaction.c:
+ $(LN) -s sigaction.c $@
+
+$(pthread_DIR)/pt-sigfillset.c:
+ $(LN) -s sigfillset.c $@
+
+$(pthread_DIR)/pt-sigprocmask.c:
+ $(LN) -s sigprocmask.c $@
+
objclean-y += pthread_objclean
pthread_objclean:
- $(RM) $(pthread_OUT)/*.{o,os,oS,s,S} $(pthread_OUT)/defs.h
+ $(RM) $(pthread_OUT)/*.{o,os,oS,s,S} $(pthread_OUT)/defs.h \
+ $(pthread_DIR)/pt-sigaction.c $(pthread_DIR)/pt-sigfillset.c \
+ $(pthread_DIR)/pt-sigprocmask.c
diff --git a/libpthread/nptl/sysdeps/pthread/pt-longjmp.c b/libpthread/nptl/sysdeps/pthread/pt-longjmp.c
new file mode 100644
index 000000000..f161380ea
--- /dev/null
+++ b/libpthread/nptl/sysdeps/pthread/pt-longjmp.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <setjmp.h>
+#include <stdlib.h>
+#include "pthreadP.h"
+
+void
+longjmp (jmp_buf env, int val)
+{
+ __libc_longjmp (env, val);
+}
+weak_alias (longjmp, siglongjmp)
diff --git a/libpthread/nptl/sysdeps/pthread/pthread_once.c b/libpthread/nptl/sysdeps/pthread/pthread_once.c
new file mode 100644
index 000000000..9b2cef864
--- /dev/null
+++ b/libpthread/nptl/sysdeps/pthread/pthread_once.c
@@ -0,0 +1,54 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include "pthreadP.h"
+#include <lowlevellock.h>
+
+
+
+static lll_lock_t once_lock = LLL_LOCK_INITIALIZER;
+
+
+int
+__pthread_once (once_control, init_routine)
+ pthread_once_t *once_control;
+ void (*init_routine) (void);
+{
+ /* XXX Depending on whether the LOCK_IN_ONCE_T is defined use a
+ global lock variable or one which is part of the pthread_once_t
+ object. */
+ if (*once_control == PTHREAD_ONCE_INIT)
+ {
+ lll_lock (once_lock);
+
+ /* XXX This implementation is not complete. It doesn't take
+ cancelation and fork into account. */
+ if (*once_control == PTHREAD_ONCE_INIT)
+ {
+ init_routine ();
+
+ *once_control = !PTHREAD_ONCE_INIT;
+ }
+
+ lll_unlock (once_lock);
+ }
+
+ return 0;
+}
+strong_alias (__pthread_once, pthread_once)
diff --git a/libpthread/nptl/sysdeps/pthread/pt-sigaction.c b/libpthread/nptl/sysdeps/pthread/sigaction.c
index 6ab8a5279..6ab8a5279 100644
--- a/libpthread/nptl/sysdeps/pthread/pt-sigaction.c
+++ b/libpthread/nptl/sysdeps/pthread/sigaction.c
diff --git a/libpthread/nptl/sysdeps/pthread/pt-sigfillset.c b/libpthread/nptl/sysdeps/pthread/sigfillset.c
index c95847f65..c95847f65 100644
--- a/libpthread/nptl/sysdeps/pthread/pt-sigfillset.c
+++ b/libpthread/nptl/sysdeps/pthread/sigfillset.c
diff --git a/libpthread/nptl/sysdeps/pthread/pt-sigprocmask.c b/libpthread/nptl/sysdeps/pthread/sigprocmask.c
index 3c3209384..3c3209384 100644
--- a/libpthread/nptl/sysdeps/pthread/pt-sigprocmask.c
+++ b/libpthread/nptl/sysdeps/pthread/sigprocmask.c