diff options
author | Joseph Myers <joseph@codesourcery.com> | 2012-08-08 23:22:53 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2012-08-08 23:22:53 +0000 |
commit | b36137f1d6899010a8e6d8f6e91a801a6b9d03f4 (patch) | |
tree | d1f290f98129694fb7f3e5141e953b53a821f3b8 /nptl | |
parent | 44c94c1da0d243a20539ae326567eb6dc4e1f540 (diff) | |
download | glibc-b36137f1d6899010a8e6d8f6e91a801a6b9d03f4.zip glibc-b36137f1d6899010a8e6d8f6e91a801a6b9d03f4.tar.gz glibc-b36137f1d6899010a8e6d8f6e91a801a6b9d03f4.tar.bz2 |
Remove __ASSUME_TGKILL.
Diffstat (limited to 'nptl')
-rw-r--r-- | nptl/ChangeLog | 23 | ||||
-rw-r--r-- | nptl/allocatestack.c | 12 | ||||
-rw-r--r-- | nptl/pthread_cancel.c | 13 | ||||
-rw-r--r-- | nptl/sysdeps/pthread/createthread.c | 4 | ||||
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/pt-raise.c | 14 | ||||
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/pthread_kill.c | 12 | ||||
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/raise.c | 17 |
7 files changed, 28 insertions, 67 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog index 1f0d925..1deaa6a 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,26 @@ +2012-08-08 Joseph Myers <joseph@codesourcery.com> + + * allocatestack.c (setxid_signal_thread) [__ASSUME_TGKILL]: Make + code unconditional. + (setxid_signal_thread) [!__ASSUME_TGKILL]: Remove conditional code. + * pthread_cancel.c (pthread_cancel) [__ASSUME_TGKILL]: Make code + unconditional. + (pthread_cancel) [!__ASSUME_TGKILL]: Remove conditional code. + * sysdeps/pthread/createthread.c (do_clone) [__ASSUME_TGKILL]: + Make code unconditional. + (do_clone) [!__ASSUME_TGKILL]: Remove conditional code. + * sysdeps/unix/sysv/linux/pt-raise.c (raise) [__ASSUME_TGKILL || + __NR_tgkill]: Make code unconditional. + (raise) [__ASSUME_TGKILL]: Likewise. + (raise) [!__ASSUME_TGKILL]: Remove conditional code. + * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill) + [__ASSUME_TGKILL]: Make code unconditional. + (__pthread_kill) [!__ASSUME_TGKILL]: Remove conditional code. + * sysdeps/unix/sysv/linux/raise.c (raise) [__ASSUME_TGKILL || + __NR_tgkill]: Make code unconditional. + (raise) [__ASSUME_TGKILL]: Likewise. + (raise) [!__ASSUME_TGKILL]: Remove conditional code. + 2012-08-07 Joseph Myers <joseph@codesourcery.com> * sysdeps/pthread/createthread.c (create_thread) diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c index 79c4531..799dbe3 100644 --- a/nptl/allocatestack.c +++ b/nptl/allocatestack.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2007, 2009, 2010, 2011 Free Software Foundation, Inc. +/* Copyright (C) 2002-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -1037,18 +1037,8 @@ setxid_signal_thread (struct xid_command *cmdp, struct pthread *t) int val; INTERNAL_SYSCALL_DECL (err); -#if __ASSUME_TGKILL val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid), t->tid, SIGSETXID); -#else -# ifdef __NR_tgkill - val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid), - t->tid, SIGSETXID); - if (INTERNAL_SYSCALL_ERROR_P (val, err) - && INTERNAL_SYSCALL_ERRNO (val, err) == ENOSYS) -# endif - val = INTERNAL_SYSCALL (tkill, err, 2, t->tid, SIGSETXID); -#endif /* If this failed, it must have had not started yet or else exited. */ if (!INTERNAL_SYSCALL_ERROR_P (val, err)) diff --git a/nptl/pthread_cancel.c b/nptl/pthread_cancel.c index 1bfca63..cf6e48b 100644 --- a/nptl/pthread_cancel.c +++ b/nptl/pthread_cancel.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004, 2009 Free Software Foundation, Inc. +/* Copyright (C) 2002-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -75,20 +75,9 @@ pthread_cancel (th) a signal handler. But this is no allowed, pthread_cancel is not guaranteed to be async-safe. */ int val; -#if __ASSUME_TGKILL val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid), pd->tid, SIGCANCEL); -#else -# ifdef __NR_tgkill - val = INTERNAL_SYSCALL (tgkill, err, 3, - THREAD_GETMEM (THREAD_SELF, pid), pd->tid, - SIGCANCEL); - if (INTERNAL_SYSCALL_ERROR_P (val, err) - && INTERNAL_SYSCALL_ERRNO (val, err) == ENOSYS) -# endif - val = INTERNAL_SYSCALL (tkill, err, 2, pd->tid, SIGCANCEL); -#endif if (INTERNAL_SYSCALL_ERROR_P (val, err)) result = INTERNAL_SYSCALL_ERRNO (val, err); diff --git a/nptl/sysdeps/pthread/createthread.c b/nptl/sysdeps/pthread/createthread.c index d58f8fa..e8e10dc 100644 --- a/nptl/sysdeps/pthread/createthread.c +++ b/nptl/sysdeps/pthread/createthread.c @@ -109,13 +109,9 @@ do_clone (struct pthread *pd, const struct pthread_attr *attr, send it the cancellation signal. */ INTERNAL_SYSCALL_DECL (err2); err_out: -#if __ASSUME_TGKILL (void) INTERNAL_SYSCALL (tgkill, err2, 3, THREAD_GETMEM (THREAD_SELF, pid), pd->tid, SIGCANCEL); -#else - (void) INTERNAL_SYSCALL (tkill, err2, 2, pd->tid, SIGCANCEL); -#endif /* We do not free the stack here because the canceled thread itself will do this. */ diff --git a/nptl/sysdeps/unix/sysv/linux/pt-raise.c b/nptl/sysdeps/unix/sysv/linux/pt-raise.c index 39ba5d3..71face4 100644 --- a/nptl/sysdeps/unix/sysv/linux/pt-raise.c +++ b/nptl/sysdeps/unix/sysv/linux/pt-raise.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 2002-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -27,25 +27,13 @@ int raise (sig) int sig; { -#if __ASSUME_TGKILL || defined __NR_tgkill /* raise is an async-safe function. It could be called while the fork function temporarily invalidated the PID field. Adjust for that. */ pid_t pid = THREAD_GETMEM (THREAD_SELF, pid); if (__builtin_expect (pid < 0, 0)) pid = -pid; -#endif -#if __ASSUME_TGKILL return INLINE_SYSCALL (tgkill, 3, pid, THREAD_GETMEM (THREAD_SELF, tid), sig); -#else -# ifdef __NR_tgkill - int res = INLINE_SYSCALL (tgkill, 3, pid, THREAD_GETMEM (THREAD_SELF, tid), - sig); - if (res != -1 || errno != ENOSYS) - return res; -# endif - return INLINE_SYSCALL (tkill, 2, THREAD_GETMEM (THREAD_SELF, tid), sig); -#endif } diff --git a/nptl/sysdeps/unix/sysv/linux/pthread_kill.c b/nptl/sysdeps/unix/sysv/linux/pthread_kill.c index b2a1422..6804bf2 100644 --- a/nptl/sysdeps/unix/sysv/linux/pthread_kill.c +++ b/nptl/sysdeps/unix/sysv/linux/pthread_kill.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004, 2006, 2011 Free Software Foundation, Inc. +/* Copyright (C) 2002-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -58,18 +58,8 @@ __pthread_kill (threadid, signo) fork, it would have to happen in a signal handler. But this is no allowed, pthread_kill is not guaranteed to be async-safe. */ int val; -#if __ASSUME_TGKILL val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid), tid, signo); -#else -# ifdef __NR_tgkill - val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid), - tid, signo); - if (INTERNAL_SYSCALL_ERROR_P (val, err) - && INTERNAL_SYSCALL_ERRNO (val, err) == ENOSYS) -# endif - val = INTERNAL_SYSCALL (tkill, err, 2, tid, signo); -#endif return (INTERNAL_SYSCALL_ERROR_P (val, err) ? INTERNAL_SYSCALL_ERRNO (val, err) : 0); diff --git a/nptl/sysdeps/unix/sysv/linux/raise.c b/nptl/sysdeps/unix/sysv/linux/raise.c index 0664278..268ab46 100644 --- a/nptl/sysdeps/unix/sysv/linux/raise.c +++ b/nptl/sysdeps/unix/sysv/linux/raise.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 2002-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -29,9 +29,7 @@ raise (sig) int sig; { struct pthread *pd = THREAD_SELF; -#if __ASSUME_TGKILL || defined __NR_tgkill pid_t pid = THREAD_GETMEM (pd, pid); -#endif pid_t selftid = THREAD_GETMEM (pd, tid); if (selftid == 0) { @@ -44,31 +42,18 @@ raise (sig) #endif THREAD_SETMEM (pd, tid, selftid); -#if __ASSUME_TGKILL || defined __NR_tgkill /* We do not set the PID field in the TID here since we might be called from a signal handler while the thread executes fork. */ pid = selftid; -#endif } -#if __ASSUME_TGKILL || defined __NR_tgkill else /* raise is an async-safe function. It could be called while the fork/vfork function temporarily invalidated the PID field. Adjust for that. */ if (__builtin_expect (pid <= 0, 0)) pid = (pid & INT_MAX) == 0 ? selftid : -pid; -#endif -#if __ASSUME_TGKILL return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig); -#else -# ifdef __NR_tgkill - int res = INLINE_SYSCALL (tgkill, 3, pid, selftid, sig); - if (res != -1 || errno != ENOSYS) - return res; -# endif - return INLINE_SYSCALL (tkill, 2, selftid, sig); -#endif } libc_hidden_def (raise) weak_alias (raise, gsignal) |