summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2018-03-19 01:07:44 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-03-19 01:35:21 +0100
commit5aa60db21b545797f47808603c97ffc168a45dd9 (patch)
treeccd0d9654c19f1adb51f3cafaf0dab59f96e5f4d
parent13222caf06cce1225122a7ae92d6e782145718ab (diff)
Avoid installing private pthread.h
It was actually by mistake that sysdeps/pthread/pthread.h was getting installed and that we'd have an include/pthread/pthread.h. Let's simplify this. * sysdeps/pthread/pthread.h: Move file content to... * ./sysdeps/pthread/pthreadP.h: ... here. * sysdeps/generic/pthread/pthread.h: Move file to... * sysdeps/generic/pthread.h: ... here. * Makefile (headers): Remove pthread/pthread.h. * Makeconfig (includes): Remove -I$(..)htl/include. * pthread/cthreads-compat.c: Include <pthreadP.h> instead of <pthread.h>
-rw-r--r--Makeconfig2
-rw-r--r--Makefile4
-rw-r--r--pthread/cthreads-compat.c2
-rw-r--r--sysdeps/generic/pthread.h (renamed from sysdeps/generic/pthread/pthread.h)0
-rw-r--r--sysdeps/pthread/pthread.h22
-rw-r--r--sysdeps/pthread/pthreadP.h18
6 files changed, 20 insertions, 28 deletions
diff --git a/Makeconfig b/Makeconfig
index 044c4e6..3af4c1d 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -9,5 +9,3 @@ static-thread-library = $(common-objpfx)htl/libpthread.a
bounded-thread-library = $(static-thread-library)
rpath-dirs += htl
-
-+includes += -I$(..)htl/include
diff --git a/Makefile b/Makefile
index 458213d..79cda56 100644
--- a/Makefile
+++ b/Makefile
@@ -141,7 +141,6 @@ libpthread-static-only-routines = pt-atfork
headers := \
pthread.h \
- pthread/pthread.h \
semaphore.h \
\
bits/pthread.h \
@@ -186,8 +185,7 @@ SYSDEP_PATH = $(srcdir)/sysdeps/$(MICROKERNEL)/hurd/i386 \
$(srcdir)/sysdeps/hurd \
$(srcdir)/sysdeps/generic \
$(srcdir)/sysdeps/posix \
- $(srcdir)/pthread \
- $(srcdir)/include
+ $(srcdir)/pthread
VPATH += $(SYSDEP_PATH)
diff --git a/pthread/cthreads-compat.c b/pthread/cthreads-compat.c
index ffb7177..042ed64 100644
--- a/pthread/cthreads-compat.c
+++ b/pthread/cthreads-compat.c
@@ -17,7 +17,7 @@
not, see <http://www.gnu.org/licenses/>. */
#include <assert.h>
-#include <pthread.h>
+#include <pthreadP.h>
#define CTHREAD_KEY_INVALID (__cthread_key_t) -1
diff --git a/sysdeps/generic/pthread/pthread.h b/sysdeps/generic/pthread.h
index d2e73c2..d2e73c2 100644
--- a/sysdeps/generic/pthread/pthread.h
+++ b/sysdeps/generic/pthread.h
diff --git a/sysdeps/pthread/pthread.h b/sysdeps/pthread/pthread.h
deleted file mode 100644
index 8e65b05..0000000
--- a/sysdeps/pthread/pthread.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef _PTHREAD_H
-#include <pthread/pthread.h>
-
-/* These represent the interface used by glibc itself. */
-
-extern int __pthread_mutex_lock (pthread_mutex_t *__mutex);
-extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex);
-
-typedef struct __cthread *__cthread_t;
-typedef int __cthread_key_t;
-typedef void * (*__cthread_fn_t)(void *__arg);
-
-__cthread_t __cthread_fork (__cthread_fn_t, void *);
-void __cthread_detach (__cthread_t);
-int __cthread_keycreate (__cthread_key_t *);
-int __cthread_getspecific (__cthread_key_t, void **);
-int __cthread_setspecific (__cthread_key_t, void *);
-
-int __pthread_getattr_np (pthread_t, pthread_attr_t *);
-int __pthread_attr_getstack (const pthread_attr_t *, void **, size_t *);
-
-#endif
diff --git a/sysdeps/pthread/pthreadP.h b/sysdeps/pthread/pthreadP.h
index fa88d2e..5559fd3 100644
--- a/sysdeps/pthread/pthreadP.h
+++ b/sysdeps/pthread/pthreadP.h
@@ -20,8 +20,26 @@
#include <pthread.h>
+/* These represent the interface used by glibc itself. */
+
extern pthread_t __pthread_self (void);
extern int __pthread_kill (pthread_t threadid, int signo);
extern struct __pthread **__pthread_threads;
+extern int __pthread_mutex_lock (pthread_mutex_t *__mutex);
+extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex);
+
+typedef struct __cthread *__cthread_t;
+typedef int __cthread_key_t;
+typedef void * (*__cthread_fn_t)(void *__arg);
+
+__cthread_t __cthread_fork (__cthread_fn_t, void *);
+void __cthread_detach (__cthread_t);
+int __cthread_keycreate (__cthread_key_t *);
+int __cthread_getspecific (__cthread_key_t, void **);
+int __cthread_setspecific (__cthread_key_t, void *);
+
+int __pthread_getattr_np (pthread_t, pthread_attr_t *);
+int __pthread_attr_getstack (const pthread_attr_t *, void **, size_t *);
+
#endif /* pthreadP.h */