This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 1/2] Introduce pthread_self_t
- From: Richard Henderson <rth at twiddle dot net>
- To: libc-alpha at sourceware dot org
- Date: Thu, 8 Oct 2015 14:58:24 +1100
- Subject: [PATCH 1/2] Introduce pthread_self_t
- Authentication-results: sourceware.org; auth=none
- References: <1444276705-6797-1-git-send-email-rth at twiddle dot net>
This will allow us to prefer using a type with an address space.
---
csu/libc-start.c | 2 +-
nptl/allocatestack.c | 4 ++--
nptl/cancellation.c | 4 ++--
nptl/cleanup.c | 2 +-
nptl/cleanup_compat.c | 4 ++--
nptl/cleanup_defer.c | 4 ++--
nptl/cleanup_defer_compat.c | 4 ++--
nptl/nptl-init.c | 6 +++---
nptl/pt-cleanup.c | 2 +-
nptl/pthreadP.h | 2 +-
nptl/pthread_create.c | 4 ++--
nptl/pthread_join.c | 2 +-
nptl/pthread_setcancelstate.c | 4 +---
nptl/pthread_setcanceltype.c | 2 +-
nptl/pthread_setspecific.c | 4 +---
nptl/pthread_timedjoin.c | 3 +--
nptl/pthread_tryjoin.c | 3 +--
nptl/tpp.c | 4 ++--
nptl/unwind.c | 4 ++--
sysdeps/aarch64/nptl/tls.h | 2 ++
sysdeps/alpha/nptl/tls.h | 2 ++
sysdeps/arm/nptl/tls.h | 2 ++
sysdeps/hppa/nptl/tls.h | 2 ++
sysdeps/i386/nptl/tls.h | 2 ++
sysdeps/ia64/nptl/tls.h | 3 ++-
sysdeps/m68k/nptl/tls.h | 2 ++
sysdeps/mach/hurd/i386/tls.h | 3 +++
sysdeps/microblaze/nptl/tls.h | 2 ++
sysdeps/mips/nptl/tls.h | 2 ++
sysdeps/nacl/exit-thread.h | 2 +-
sysdeps/nios2/nptl/tls.h | 2 ++
sysdeps/nptl/fork.c | 2 +-
sysdeps/powerpc/nptl/tls.h | 2 ++
sysdeps/s390/nptl/tls.h | 2 ++
sysdeps/sh/nptl/tls.h | 2 ++
sysdeps/sparc/nptl/tls.h | 2 ++
sysdeps/tile/nptl/tls.h | 2 ++
sysdeps/unix/sysv/linux/raise.c | 2 +-
sysdeps/x86_64/nptl/tls.h | 2 ++
39 files changed, 67 insertions(+), 39 deletions(-)
diff --git a/csu/libc-start.c b/csu/libc-start.c
index 0afa7c0..899fc9b 100644
--- a/csu/libc-start.c
+++ b/csu/libc-start.c
@@ -276,7 +276,7 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
not_first_call = setjmp ((struct __jmp_buf_tag *) unwind_buf.cancel_jmp_buf);
if (__glibc_likely (! not_first_call))
{
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
/* Store old info. */
unwind_buf.priv.data.prev = THREAD_GETMEM (self, cleanup_jmp_buf);
diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
index 753da61..b08c36c 100644
--- a/nptl/allocatestack.c
+++ b/nptl/allocatestack.c
@@ -1094,7 +1094,7 @@ __nptl_setxid (struct xid_command *cmdp)
cmdp->cntr = 0;
cmdp->error = -1;
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
/* Iterate over the list with system-allocated threads first. */
list_t *runp;
@@ -1235,7 +1235,7 @@ __wait_lookup_done (void)
{
lll_lock (stack_cache_lock, LLL_PRIVATE);
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
/* Iterate over the list with system-allocated threads first. */
list_t *runp;
diff --git a/nptl/cancellation.c b/nptl/cancellation.c
index 2bd3168..d0ef9fe 100644
--- a/nptl/cancellation.c
+++ b/nptl/cancellation.c
@@ -29,7 +29,7 @@ int
attribute_hidden
__pthread_enable_asynccancel (void)
{
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
int oldval = THREAD_GETMEM (self, cancelhandling);
while (1)
@@ -69,7 +69,7 @@ __pthread_disable_asynccancel (int oldtype)
if (oldtype & CANCELTYPE_BITMASK)
return;
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
int newval;
int oldval = THREAD_GETMEM (self, cancelhandling);
diff --git a/nptl/cleanup.c b/nptl/cleanup.c
index 95923ba..4eb38a5 100644
--- a/nptl/cleanup.c
+++ b/nptl/cleanup.c
@@ -25,7 +25,7 @@ __cleanup_fct_attribute
__pthread_register_cancel (__pthread_unwind_buf_t *buf)
{
struct pthread_unwind_buf *ibuf = (struct pthread_unwind_buf *) buf;
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
/* Store old info. */
ibuf->priv.data.prev = THREAD_GETMEM (self, cleanup_jmp_buf);
diff --git a/nptl/cleanup_compat.c b/nptl/cleanup_compat.c
index d4e96ae..37df105 100644
--- a/nptl/cleanup_compat.c
+++ b/nptl/cleanup_compat.c
@@ -26,7 +26,7 @@ _pthread_cleanup_push (buffer, routine, arg)
void (*routine) (void *);
void *arg;
{
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
buffer->__routine = routine;
buffer->__arg = arg;
@@ -42,7 +42,7 @@ _pthread_cleanup_pop (buffer, execute)
struct _pthread_cleanup_buffer *buffer;
int execute;
{
- struct pthread *self __attribute ((unused)) = THREAD_SELF;
+ pthread_self_t *self __attribute ((unused)) = THREAD_SELF;
THREAD_SETMEM (self, cleanup, buffer->__prev);
diff --git a/nptl/cleanup_defer.c b/nptl/cleanup_defer.c
index 26b955e..b7919e3 100644
--- a/nptl/cleanup_defer.c
+++ b/nptl/cleanup_defer.c
@@ -25,7 +25,7 @@ __cleanup_fct_attribute
__pthread_register_cancel_defer (__pthread_unwind_buf_t *buf)
{
struct pthread_unwind_buf *ibuf = (struct pthread_unwind_buf *) buf;
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
/* Store old info. */
ibuf->priv.data.prev = THREAD_GETMEM (self, cleanup_jmp_buf);
@@ -62,7 +62,7 @@ void
__cleanup_fct_attribute
__pthread_unregister_cancel_restore (__pthread_unwind_buf_t *buf)
{
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
struct pthread_unwind_buf *ibuf = (struct pthread_unwind_buf *) buf;
THREAD_SETMEM (self, cleanup_jmp_buf, ibuf->priv.data.prev);
diff --git a/nptl/cleanup_defer_compat.c b/nptl/cleanup_defer_compat.c
index bd70b89..258194e 100644
--- a/nptl/cleanup_defer_compat.c
+++ b/nptl/cleanup_defer_compat.c
@@ -25,7 +25,7 @@ _pthread_cleanup_push_defer (buffer, routine, arg)
void (*routine) (void *);
void *arg;
{
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
buffer->__routine = routine;
buffer->__arg = arg;
@@ -63,7 +63,7 @@ _pthread_cleanup_pop_restore (buffer, execute)
struct _pthread_cleanup_buffer *buffer;
int execute;
{
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
THREAD_SETMEM (self, cleanup, buffer->__prev);
diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c
index 79bcaab..f7be6a0 100644
--- a/nptl/nptl-init.c
+++ b/nptl/nptl-init.c
@@ -199,7 +199,7 @@ sigcancel_handler (int sig, siginfo_t *si, void *ctx)
|| si->si_code != SI_TKILL)
return;
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
int oldval = THREAD_GETMEM (self, cancelhandling);
while (1)
@@ -268,7 +268,7 @@ sighandler_setxid (int sig, siginfo_t *si, void *ctx)
__nptl_setxid_error (__xidcmd, error);
/* Reset the SETXID flag. */
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
int flags, newval;
do
{
@@ -312,7 +312,7 @@ __pthread_initialize_minimal_internal (void)
#endif
/* Minimal initialization of the thread descriptor. */
- struct pthread *pd = THREAD_SELF;
+ pthread_self_t *pd = THREAD_SELF;
__pthread_initialize_pids (pd);
THREAD_SETMEM (pd, specific[0], &pd->specific_1stblock[0]);
THREAD_SETMEM (pd, user_stack, true);
diff --git a/nptl/pt-cleanup.c b/nptl/pt-cleanup.c
index ce239a6..1defd98 100644
--- a/nptl/pt-cleanup.c
+++ b/nptl/pt-cleanup.c
@@ -24,7 +24,7 @@
void
__pthread_cleanup_upto (__jmp_buf target, char *targetframe)
{
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
struct _pthread_cleanup_buffer *cbuf;
/* Adjust all pointers used in comparisons, so that top of thread's
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index b96be56..15e65c0 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -275,7 +275,7 @@ static inline void
__attribute ((noreturn, always_inline))
__do_cancel (void)
{
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
/* Make sure we get no more cancellations. */
THREAD_ATOMIC_BIT_SET (self, cancelhandling, EXITING_BIT);
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
index d10f4ea..29d5c06 100644
--- a/nptl/pthread_create.c
+++ b/nptl/pthread_create.c
@@ -124,7 +124,7 @@ void
attribute_hidden
__nptl_deallocate_tsd (void)
{
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
/* Maybe no data was ever allocated. This happens often so we have
a flag for this. */
@@ -559,7 +559,7 @@ __pthread_create_2_1 (newthread, attr, start_routine, arg)
pd->arg = arg;
/* Copy the thread attribute flags. */
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
pd->flags = ((iattr->flags & ~(ATTR_FLAG_SCHED_SET | ATTR_FLAG_POLICY_SET))
| (self->flags & (ATTR_FLAG_SCHED_SET | ATTR_FLAG_POLICY_SET)));
diff --git a/nptl/pthread_join.c b/nptl/pthread_join.c
index c841ff9..8170f90 100644
--- a/nptl/pthread_join.c
+++ b/nptl/pthread_join.c
@@ -51,7 +51,7 @@ pthread_join (pthread_t threadid, void **thread_return)
/* We cannot wait for the thread. */
return EINVAL;
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
int result = 0;
LIBC_PROBE (pthread_join, 1, threadid);
diff --git a/nptl/pthread_setcancelstate.c b/nptl/pthread_setcancelstate.c
index c8bc8b8..3dd0c19 100644
--- a/nptl/pthread_setcancelstate.c
+++ b/nptl/pthread_setcancelstate.c
@@ -26,12 +26,10 @@ __pthread_setcancelstate (state, oldstate)
int state;
int *oldstate;
{
- volatile struct pthread *self;
-
if (state < PTHREAD_CANCEL_ENABLE || state > PTHREAD_CANCEL_DISABLE)
return EINVAL;
- self = THREAD_SELF;
+ volatile pthread_self_t *self = THREAD_SELF;
int oldval = THREAD_GETMEM (self, cancelhandling);
while (1)
diff --git a/nptl/pthread_setcanceltype.c b/nptl/pthread_setcanceltype.c
index 11eff86..62e0e5e 100644
--- a/nptl/pthread_setcanceltype.c
+++ b/nptl/pthread_setcanceltype.c
@@ -34,7 +34,7 @@ __pthread_setcanceltype (type, oldtype)
return ENOTSUP;
#endif
- volatile struct pthread *self = THREAD_SELF;
+ volatile pthread_self_t *self = THREAD_SELF;
int oldval = THREAD_GETMEM (self, cancelhandling);
while (1)
diff --git a/nptl/pthread_setspecific.c b/nptl/pthread_setspecific.c
index a9cf26c..05fa8e6 100644
--- a/nptl/pthread_setspecific.c
+++ b/nptl/pthread_setspecific.c
@@ -26,14 +26,12 @@ __pthread_setspecific (key, value)
pthread_key_t key;
const void *value;
{
- struct pthread *self;
+ pthread_self_t *self = THREAD_SELF;
unsigned int idx1st;
unsigned int idx2nd;
struct pthread_key_data *level2;
unsigned int seq;
- self = THREAD_SELF;
-
/* Special case access to the first 2nd-level block. This is the
usual case. */
if (__glibc_likely (key < PTHREAD_KEY_2NDLEVEL_SIZE))
diff --git a/nptl/pthread_timedjoin.c b/nptl/pthread_timedjoin.c
index 10567e6..d8f99b8 100644
--- a/nptl/pthread_timedjoin.c
+++ b/nptl/pthread_timedjoin.c
@@ -33,7 +33,6 @@ int
pthread_timedjoin_np (pthread_t threadid, void **thread_return,
const struct timespec *abstime)
{
- struct pthread *self;
struct pthread *pd = (struct pthread *) threadid;
int result;
@@ -47,7 +46,7 @@ pthread_timedjoin_np (pthread_t threadid, void **thread_return,
/* We cannot wait for the thread. */
return EINVAL;
- self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
if (pd == self || self->joinid == pd)
/* This is a deadlock situation. The threads are waiting for each
other to finish. Note that this is a "may" error. To be 100%
diff --git a/nptl/pthread_tryjoin.c b/nptl/pthread_tryjoin.c
index 3305844..c84dd12 100644
--- a/nptl/pthread_tryjoin.c
+++ b/nptl/pthread_tryjoin.c
@@ -28,7 +28,6 @@ pthread_tryjoin_np (threadid, thread_return)
pthread_t threadid;
void **thread_return;
{
- struct pthread *self;
struct pthread *pd = (struct pthread *) threadid;
/* Make sure the descriptor is valid. */
@@ -41,7 +40,7 @@ pthread_tryjoin_np (threadid, thread_return)
/* We cannot wait for the thread. */
return EINVAL;
- self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
if (pd == self || self->joinid == pd)
/* This is a deadlock situation. The threads are waiting for each
other to finish. Note that this is a "may" error. To be 100%
diff --git a/nptl/tpp.c b/nptl/tpp.c
index 142c618..af3cd03e 100644
--- a/nptl/tpp.c
+++ b/nptl/tpp.c
@@ -51,7 +51,7 @@ __init_sched_fifo_prio (void)
int
__pthread_tpp_change_priority (int previous_prio, int new_prio)
{
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
struct priority_protection_data *tpp = THREAD_GETMEM (self, tpp);
int fifo_min_prio = atomic_load_relaxed (&__sched_fifo_min_prio);
int fifo_max_prio = atomic_load_relaxed (&__sched_fifo_max_prio);
@@ -158,7 +158,7 @@ __pthread_tpp_change_priority (int previous_prio, int new_prio)
int
__pthread_current_priority (void)
{
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
if ((self->flags & (ATTR_FLAG_POLICY_SET | ATTR_FLAG_SCHED_SET))
== (ATTR_FLAG_POLICY_SET | ATTR_FLAG_SCHED_SET))
return self->schedparam.sched_priority;
diff --git a/nptl/unwind.c b/nptl/unwind.c
index 904187e..981a805 100644
--- a/nptl/unwind.c
+++ b/nptl/unwind.c
@@ -44,7 +44,7 @@ unwind_stop (int version, _Unwind_Action actions,
struct _Unwind_Context *context, void *stop_parameter)
{
struct pthread_unwind_buf *buf = stop_parameter;
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
struct _pthread_cleanup_buffer *curp = THREAD_GETMEM (self, cleanup);
int do_longjump = 0;
@@ -115,7 +115,7 @@ __cleanup_fct_attribute __attribute ((noreturn))
__pthread_unwind (__pthread_unwind_buf_t *buf)
{
struct pthread_unwind_buf *ibuf = (struct pthread_unwind_buf *) buf;
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
#ifdef HAVE_FORCED_UNWIND
/* This is not a catchable exception, so don't provide any details about
diff --git a/sysdeps/aarch64/nptl/tls.h b/sysdeps/aarch64/nptl/tls.h
index 1e3904e..cfdf3bb 100644
--- a/sysdeps/aarch64/nptl/tls.h
+++ b/sysdeps/aarch64/nptl/tls.h
@@ -37,6 +37,8 @@ typedef union dtv
} pointer;
} dtv_t;
+typedef struct pthread pthread_self_t;
+
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
#endif /* __ASSEMBLER__ */
diff --git a/sysdeps/alpha/nptl/tls.h b/sysdeps/alpha/nptl/tls.h
index 4eddf40..1b6b05b 100644
--- a/sysdeps/alpha/nptl/tls.h
+++ b/sysdeps/alpha/nptl/tls.h
@@ -53,6 +53,8 @@ typedef struct
void *__private;
} tcbhead_t;
+typedef struct pthread pthread_self_t;
+
/* This is the size of the initial TCB. */
# define TLS_INIT_TCB_SIZE sizeof (tcbhead_t)
diff --git a/sysdeps/arm/nptl/tls.h b/sysdeps/arm/nptl/tls.h
index 27ea006..3bdde5f 100644
--- a/sysdeps/arm/nptl/tls.h
+++ b/sysdeps/arm/nptl/tls.h
@@ -37,6 +37,8 @@ typedef union dtv
} pointer;
} dtv_t;
+typedef struct pthread pthread_self_t;
+
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
#endif /* __ASSEMBLER__ */
diff --git a/sysdeps/hppa/nptl/tls.h b/sysdeps/hppa/nptl/tls.h
index 88a0486..727b943 100644
--- a/sysdeps/hppa/nptl/tls.h
+++ b/sysdeps/hppa/nptl/tls.h
@@ -37,6 +37,8 @@ typedef union dtv
} pointer;
} dtv_t;
+typedef struct pthread pthread_self_t;
+
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
#endif /* __ASSEMBLER__ */
diff --git a/sysdeps/i386/nptl/tls.h b/sysdeps/i386/nptl/tls.h
index 829cd3a..30d1e64 100644
--- a/sysdeps/i386/nptl/tls.h
+++ b/sysdeps/i386/nptl/tls.h
@@ -64,6 +64,8 @@ typedef struct
void *__private_ss;
} tcbhead_t;
+typedef struct pthread pthread_self_t;
+
# define TLS_MULTIPLE_THREADS_IN_TCB 1
#else /* __ASSEMBLER__ */
diff --git a/sysdeps/ia64/nptl/tls.h b/sysdeps/ia64/nptl/tls.h
index 1668fd4..5a87387 100644
--- a/sysdeps/ia64/nptl/tls.h
+++ b/sysdeps/ia64/nptl/tls.h
@@ -46,7 +46,8 @@ typedef struct
void *__private;
} tcbhead_t;
-register struct pthread *__thread_self __asm__("r13");
+typedef struct pthread pthread_self_t;
+register pthread_self_t *__thread_self __asm__("r13");
# define TLS_MULTIPLE_THREADS_IN_TCB 1
diff --git a/sysdeps/m68k/nptl/tls.h b/sysdeps/m68k/nptl/tls.h
index 93bc1ad0..47b62ce 100644
--- a/sysdeps/m68k/nptl/tls.h
+++ b/sysdeps/m68k/nptl/tls.h
@@ -38,6 +38,8 @@ typedef union dtv
} pointer;
} dtv_t;
+typedef struct pthread pthread_self_t;
+
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
#endif /* __ASSEMBLER__ */
diff --git a/sysdeps/mach/hurd/i386/tls.h b/sysdeps/mach/hurd/i386/tls.h
index ca68d1c..0971c25 100644
--- a/sysdeps/mach/hurd/i386/tls.h
+++ b/sysdeps/mach/hurd/i386/tls.h
@@ -54,6 +54,9 @@ typedef struct
/* GCC split stack support. */
void *__private_ss;
} tcbhead_t;
+
+typedef struct pthread pthread_self_t;
+
#endif
diff --git a/sysdeps/microblaze/nptl/tls.h b/sysdeps/microblaze/nptl/tls.h
index 171a745..f278531 100644
--- a/sysdeps/microblaze/nptl/tls.h
+++ b/sysdeps/microblaze/nptl/tls.h
@@ -37,6 +37,8 @@ typedef union dtv
} pointer;
} dtv_t;
+typedef struct pthread pthread_self_t;
+
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
#endif /* __ASSEMBLER__ */
diff --git a/sysdeps/mips/nptl/tls.h b/sysdeps/mips/nptl/tls.h
index e69c397..5750f26 100644
--- a/sysdeps/mips/nptl/tls.h
+++ b/sysdeps/mips/nptl/tls.h
@@ -39,6 +39,8 @@ typedef union dtv
} pointer;
} dtv_t;
+typedef struct pthread pthread_self_t;
+
#ifdef __mips16
/* MIPS16 uses GCC builtin to access the TP. */
# define READ_THREAD_POINTER() (__builtin_thread_pointer ())
diff --git a/sysdeps/nacl/exit-thread.h b/sysdeps/nacl/exit-thread.h
index 915f93d..5c8ad3c 100644
--- a/sysdeps/nacl/exit-thread.h
+++ b/sysdeps/nacl/exit-thread.h
@@ -29,7 +29,7 @@
static inline void __attribute__ ((noreturn, always_inline, unused))
__exit_thread (void)
{
- struct pthread *pd = THREAD_SELF;
+ pthread_self_t *pd = THREAD_SELF;
/* The generic logic for pthread_join and stack/descriptor reuse is
based on the Linux kernel feature that will clear and futex-wake
diff --git a/sysdeps/nios2/nptl/tls.h b/sysdeps/nios2/nptl/tls.h
index 465a4b9..ae44a5f 100644
--- a/sysdeps/nios2/nptl/tls.h
+++ b/sysdeps/nios2/nptl/tls.h
@@ -37,6 +37,8 @@ typedef union dtv
} pointer;
} dtv_t;
+typedef struct pthread pthread_self_t;
+
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
#endif /* __ASSEMBLER__ */
diff --git a/sysdeps/nptl/fork.c b/sysdeps/nptl/fork.c
index 1e251bd..2e8bba3 100644
--- a/sysdeps/nptl/fork.c
+++ b/sysdeps/nptl/fork.c
@@ -131,7 +131,7 @@ __libc_fork (void)
if (pid == 0)
{
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
assert (THREAD_GETMEM (self, tid) != ppid);
diff --git a/sysdeps/powerpc/nptl/tls.h b/sysdeps/powerpc/nptl/tls.h
index 1f3d97a..79a068f 100644
--- a/sysdeps/powerpc/nptl/tls.h
+++ b/sysdeps/powerpc/nptl/tls.h
@@ -37,6 +37,8 @@ typedef union dtv
} pointer;
} dtv_t;
+typedef struct pthread pthread_self_t;
+
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
#endif /* __ASSEMBLER__ */
diff --git a/sysdeps/s390/nptl/tls.h b/sysdeps/s390/nptl/tls.h
index e6f8a47..309edb7 100644
--- a/sysdeps/s390/nptl/tls.h
+++ b/sysdeps/s390/nptl/tls.h
@@ -56,6 +56,8 @@ typedef struct
#endif
} tcbhead_t;
+typedef struct pthread pthread_self_t;
+
# ifndef __s390x__
# define TLS_MULTIPLE_THREADS_IN_TCB 1
# endif
diff --git a/sysdeps/sh/nptl/tls.h b/sysdeps/sh/nptl/tls.h
index 9615a76..ef18d40 100644
--- a/sysdeps/sh/nptl/tls.h
+++ b/sysdeps/sh/nptl/tls.h
@@ -46,6 +46,8 @@ typedef struct
uintptr_t pointer_guard;
} tcbhead_t;
+typedef struct pthread pthread_self_t;
+
# define TLS_MULTIPLE_THREADS_IN_TCB 1
#else /* __ASSEMBLER__ */
diff --git a/sysdeps/sparc/nptl/tls.h b/sysdeps/sparc/nptl/tls.h
index 54bce7e..d01826f 100644
--- a/sysdeps/sparc/nptl/tls.h
+++ b/sysdeps/sparc/nptl/tls.h
@@ -60,6 +60,8 @@ typedef struct
#endif
} tcbhead_t;
+typedef struct pthread pthread_self_t;
+
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
#endif /* __ASSEMBLER__ */
diff --git a/sysdeps/tile/nptl/tls.h b/sysdeps/tile/nptl/tls.h
index 08e1d54..6d4bfd0 100644
--- a/sysdeps/tile/nptl/tls.h
+++ b/sysdeps/tile/nptl/tls.h
@@ -37,6 +37,8 @@ typedef union dtv
} pointer;
} dtv_t;
+typedef struct pthread pthread_self_t;
+
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
#endif /* __ASSEMBLER__ */
diff --git a/sysdeps/unix/sysv/linux/raise.c b/sysdeps/unix/sysv/linux/raise.c
index e281063..a9c9da5 100644
--- a/sysdeps/unix/sysv/linux/raise.c
+++ b/sysdeps/unix/sysv/linux/raise.c
@@ -27,7 +27,7 @@ int
raise (sig)
int sig;
{
- struct pthread *pd = THREAD_SELF;
+ pthread_self_t *pd = THREAD_SELF;
pid_t pid = THREAD_GETMEM (pd, pid);
pid_t selftid = THREAD_GETMEM (pd, tid);
if (selftid == 0)
diff --git a/sysdeps/x86_64/nptl/tls.h b/sysdeps/x86_64/nptl/tls.h
index b73e7ed..bbc45f0 100644
--- a/sysdeps/x86_64/nptl/tls.h
+++ b/sysdeps/x86_64/nptl/tls.h
@@ -80,6 +80,8 @@ typedef struct
void *__padding[8];
} tcbhead_t;
+typedef struct pthread pthread_self_t;
+
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
#endif
--
2.4.3