]> sourceware.org Git - glibc.git/commitdiff
* sysdeps/unix/sysv/linux/ia64/sigsuspend.c: File removed. cvs/fedora-glibc-20060731T0706
authorRoland McGrath <roland@gnu.org>
Mon, 31 Jul 2006 05:58:51 +0000 (05:58 +0000)
committerRoland McGrath <roland@gnu.org>
Mon, 31 Jul 2006 05:58:51 +0000 (05:58 +0000)
* sysdeps/unix/sysv/linux/x86_64/sigsuspend.c: File removed.
* sysdeps/unix/sysv/linux/s390/s390-64/sigsuspend.c: File removed.
* sysdeps/unix/sysv/linux/sparc/sparc64/sigsuspend.c: File removed.

* sysdeps/unix/sysv/linux/not-cancel.h (pause_not_cancel): New macro.
(nanosleep_not_cancel): New macro.
(sigsuspend_not_cancel): new macro.
* sysdeps/unix/sysv/linux/sigsuspend.c [__ASSUME_REALTIME_SIGNALS]
(do_sigsuspend): Define as inline.
(__sigsuspend): Always use do_sigsuspend.
[! NO_CANCELLATION] (__sigsuspend_nocancel): New function.
* include/signal.h: Declare __sigsuspend_nocancel.
* sysdeps/posix/pause.c
[! NO_CANCELLATION] (__pause_nocancel): New function.

* include/unistd.h (__pause_nocancel): Add attribute_hidden.
* include/time.h (__nanosleep_nocancel): Likewise.

14 files changed:
ChangeLog
include/signal.h
nptl/ChangeLog
nptl/Makefile
nptl/pthread_mutex_lock.c
nptl/pthread_mutex_timedlock.c
nptl/sysdeps/unix/sysv/linux/i386/not-cancel.h
sysdeps/posix/pause.c
sysdeps/unix/sysv/linux/ia64/sigsuspend.c [deleted file]
sysdeps/unix/sysv/linux/not-cancel.h
sysdeps/unix/sysv/linux/s390/s390-64/sigsuspend.c [deleted file]
sysdeps/unix/sysv/linux/sigsuspend.c
sysdeps/unix/sysv/linux/sparc/sparc64/sigsuspend.c [deleted file]
sysdeps/unix/sysv/linux/x86_64/sigsuspend.c [deleted file]

index e603347a0b7ca5778c4dbaea3dcc172bee9f2531..7d172adb0fdb8d7cb6849e8327ed2821a5c9b130 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2006-07-30  Roland McGrath  <roland@redhat.com>
+
+       * sysdeps/unix/sysv/linux/ia64/sigsuspend.c: File removed.
+       * sysdeps/unix/sysv/linux/x86_64/sigsuspend.c: File removed.
+       * sysdeps/unix/sysv/linux/s390/s390-64/sigsuspend.c: File removed.
+       * sysdeps/unix/sysv/linux/sparc/sparc64/sigsuspend.c: File removed.
+
+       * sysdeps/unix/sysv/linux/not-cancel.h (pause_not_cancel): New macro.
+       (nanosleep_not_cancel): New macro.
+       (sigsuspend_not_cancel): new macro.
+       * sysdeps/unix/sysv/linux/sigsuspend.c [__ASSUME_REALTIME_SIGNALS]
+       (do_sigsuspend): Define as inline.
+       (__sigsuspend): Always use do_sigsuspend.
+       [! NO_CANCELLATION] (__sigsuspend_nocancel): New function.
+       * include/signal.h: Declare __sigsuspend_nocancel.
+       * sysdeps/posix/pause.c
+       [! NO_CANCELLATION] (__pause_nocancel): New function.
+
+       * include/unistd.h (__pause_nocancel): Add attribute_hidden.
+       * include/time.h (__nanosleep_nocancel): Likewise.
+
 2006-07-30  Ulrich Drepper  <drepper@redhat.com>
 
        * locale/programs/localedef.c (add_to_readlist): Rename local
index 2be67babad3c3f2d7e41d2b3242ffb1b4c554692..6bbfbcf808abdc28a1d60146388abaca02d5f2be 100644 (file)
@@ -26,6 +26,9 @@ extern int __sigprocmask (int __how,
                          __const sigset_t *__set, sigset_t *__oset);
 extern int __sigsuspend (__const sigset_t *__set);
 libc_hidden_proto (__sigsuspend)
+#ifndef NO_CANCELLATION
+extern int __sigsuspend_nocancel (__const sigset_t *__set) attribute_hidden;
+#endif
 extern int __sigwait (__const sigset_t *__set, int *__sig);
 libc_hidden_proto (__sigwait)
 extern int __sigwaitinfo (__const sigset_t *__set, siginfo_t *__info);
index 46a7f333453cdf07de69ecbdd2e189a509f7502b..0ee39eddc3114efc974dd9cbf76014746f25ddae 100644 (file)
@@ -1,3 +1,16 @@
+2006-07-30  Roland McGrath  <roland@redhat.com>
+
+       * Makefile (libpthread-routines): Add ptw-sigsuspend.
+
+       * sysdeps/unix/sysv/linux/i386/not-cancel.h
+       (pause_not_cancel): New macro.
+       (nanosleep_not_cancel): New macro.
+       (sigsuspend_not_cancel): New macro.
+       * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
+       nanosleep_not_cancel macro from <not-cancel.h>.
+       * pthread_mutex_lock.c (__pthread_mutex_lock): Use pause_not_cancel
+       macro from <not-cancel.h>.
+
 2006-07-28  Ulrich Drepper  <drepper@redhat.com>
            Jakub Jelinek  <jakub@redhat.com>
 
index a4c6174c42601be5c4ecccac5c5834f65a88145e..4023e46199425a815bc6f672262126b8b162d0a9 100644 (file)
@@ -108,7 +108,7 @@ libpthread-routines = init vars events version \
                      ptw-msync ptw-nanosleep ptw-open ptw-open64 ptw-pause \
                      ptw-pread ptw-pread64 ptw-pwrite ptw-pwrite64 \
                      ptw-tcdrain ptw-wait ptw-waitpid ptw-msgrcv ptw-msgsnd \
-                     ptw-sigwait \
+                     ptw-sigwait ptw-sigsuspend \
                      pt-raise pt-system \
                      flockfile ftrylockfile funlockfile \
                      sigaction \
index 534576688360d393ecaafe733e052a2f86780e99..a19c90769597ac60517a55329cfbf294c96f8279 100644 (file)
@@ -21,6 +21,7 @@
 #include <errno.h>
 #include <stdlib.h>
 #include <unistd.h>
+#include <not-cancel.h>
 #include "pthreadP.h"
 #include <lowlevellock.h>
 
@@ -278,7 +279,7 @@ __pthread_mutex_lock (mutex)
 
                /* Delay the thread indefinitely.  */
                while (1)
-                 __pause_nocancel ();
+                 pause_not_cancel ();
              }
 
            oldval = mutex->__data.__lock;
index 12f6c997bb2d7792c6a2fa8bd930e4f52782007c..dcff4f81a84e436c0f5bf18e074ff837fd8bc3c0 100644 (file)
 
 #include <assert.h>
 #include <errno.h>
+#include <time.h>
 #include "pthreadP.h"
 #include <lowlevellock.h>
+#include <not-cancel.h>
 
 
 int
@@ -281,7 +283,7 @@ pthread_mutex_timedlock (mutex, abstime)
                        --reltime.tv_sec;
                      }
                    if (reltime.tv_sec >= 0)
-                     while (__nanosleep_nocancel (&reltime, &reltime) != 0)
+                     while (nanosleep_not_cancel (&reltime, &reltime) != 0)
                        continue;
 
                    return ETIMEDOUT;
index 91584948ae5e4fedc21a98766516f27f9076544b..6557359b4387f1919226aa824a9712da5c5fc394 100644 (file)
@@ -91,3 +91,15 @@ extern int __openat64_nocancel (int fd, const char *fname, int oflag,
 # define waitpid_not_cancel(pid, stat_loc, options) \
   INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL)
 #endif
+
+/* Uncancelable pause.  */
+#define pause_not_cancel() \
+  __pause_nocancel ()
+
+/* Uncancelable nanosleep.  */
+#define nanosleep_not_cancel(requested_time, remaining) \
+  __nanosleep_nocancel (requested_time, remaining)
+
+/* Uncancelable sigsuspend.  */
+#define sigsuspend_not_cancel(set) \
+  __sigsuspend_nocancel (set)
index 8639e684f4a9d185257ea7021637da0a695439f0..538c186ec0dd4400c1e27042ed3ca1aa5be2e62d 100644 (file)
@@ -1,5 +1,5 @@
 /* pause -- suspend the process until a signal arrives.  POSIX.1 version.
-   Copyright (C) 2003 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2006 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
@@ -23,6 +23,7 @@
 
 /* Suspend the process until a signal arrives.
    This always returns -1 and sets errno to EINTR.  */
+
 int
 __libc_pause (void)
 {
@@ -39,3 +40,18 @@ __libc_pause (void)
 weak_alias (__libc_pause, pause)
 
 LIBC_CANCEL_HANDLED ();                /* sigsuspend handles our cancellation.  */
+
+#ifndef NO_CANCELLATION
+# include <not-cancel.h>
+
+int
+__pause_nocancel (void)
+{
+  sigset_t set;
+
+  __sigemptyset (&set);
+  __sigprocmask (SIG_BLOCK, NULL, &set);
+
+  return sigsuspend_not_cancel (&set);
+}
+#endif
diff --git a/sysdeps/unix/sysv/linux/ia64/sigsuspend.c b/sysdeps/unix/sysv/linux/ia64/sigsuspend.c
deleted file mode 100644 (file)
index f8f9563..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002, 2003
-   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
-   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 <errno.h>
-#include <signal.h>
-#include <unistd.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-#include <bp-checks.h>
-
-/* Change the set of blocked signals to SET,
-   wait until a signal arrives, and restore the set of blocked signals.  */
-int
-__sigsuspend (set)
-     const sigset_t *set;
-{
-  /* XXX The size argument hopefully will have to be changed to the
-     real size of the user-level sigset_t.  */
-  if (SINGLE_THREAD_P)
-    return INLINE_SYSCALL (rt_sigsuspend, 2, CHECK_SIGSET (set), _NSIG / 8);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  int result = INLINE_SYSCALL (rt_sigsuspend, 2, CHECK_SIGSET (set), _NSIG / 8);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
-}
-libc_hidden_def (__sigsuspend)
-weak_alias (__sigsuspend, sigsuspend)
-strong_alias (__sigsuspend, __libc_sigsuspend)
index 4a76335a5590ab0026f71ef5204ff44b26f6852b..80d33be29c701702a3182337d9e19b8883ac5e80 100644 (file)
@@ -81,3 +81,25 @@ extern int __openat64_nocancel (int fd, const char *fname, int oflag,
 # define waitpid_not_cancel(pid, stat_loc, options) \
   INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL)
 #endif
+
+/* Uncancelable pause.  */
+#ifdef __NR_pause
+# define pause_not_cancel() \
+  INLINE_SYSCALL (pause, 0)
+#else
+# define pause_not_cancel() \
+  __pause_nocancel ()
+#endif
+
+/* Uncancelable nanosleep.  */
+#ifdef __NR_nanosleep
+# define nanosleep_not_cancel(requested_time, remaining) \
+  INLINE_SYSCALL (nanosleep, 2, requested_time, remaining)
+#else
+# define nanosleep_not_cancel(requested_time, remaining) \
+  __nanosleep_nocancel (requested_time, remaining)
+#endif
+
+/* Uncancelable sigsuspend.  */
+#define sigsuspend_not_cancel(set) \
+  __sigsuspend_nocancel (set)
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sigsuspend.c b/sysdeps/unix/sysv/linux/s390/s390-64/sigsuspend.c
deleted file mode 100644 (file)
index 452f835..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Copyright (C) 2001, 2002, 2003 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
-   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 <errno.h>
-#include <signal.h>
-#include <unistd.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-/* Change the set of blocked signals to SET,
-   wait until a signal arrives, and restore the set of blocked signals.  */
-int
-__sigsuspend (set)
-     const sigset_t *set;
-{
-  /* XXX The size argument hopefully will have to be changed to the
-     real size of the user-level sigset_t.  */
-  if (SINGLE_THREAD_P)
-    return INLINE_SYSCALL (rt_sigsuspend, 2, set, _NSIG / 8);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  int result = INLINE_SYSCALL (rt_sigsuspend, 2, set, _NSIG / 8);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
-}
-libc_hidden_def (__sigsuspend)
-weak_alias (__sigsuspend, sigsuspend)
-strong_alias (__sigsuspend, __libc_sigsuspend)
index 7b9b60911b8dc941ca3902652f6e7417c0bd6776..adbdfddfdb199453a980a1ef31b519cde167ec04 100644 (file)
@@ -56,6 +56,12 @@ do_sigsuspend (const sigset_t *set)
 
   return INLINE_SYSCALL (sigsuspend, 3, 0, 0, set->__val[0]);
 }
+#else
+static inline int __attribute__ ((always_inline))
+do_sigsuspend (const sigset_t *set)
+{
+  return INLINE_SYSCALL (rt_sigsuspend, 2, CHECK_SIGSET (set), _NSIG / 8);
+}
 #endif
 
 /* Change the set of blocked signals to SET,
@@ -64,19 +70,6 @@ int
 __sigsuspend (set)
      const sigset_t *set;
 {
-#if __ASSUME_REALTIME_SIGNALS
-  if (SINGLE_THREAD_P)
-    return INLINE_SYSCALL (rt_sigsuspend, 2, CHECK_SIGSET (set), _NSIG / 8);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  int result = INLINE_SYSCALL (rt_sigsuspend, 2, CHECK_SIGSET (set),
-                              _NSIG / 8);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
-#else
   if (SINGLE_THREAD_P)
     return do_sigsuspend (set);
 
@@ -87,8 +80,16 @@ __sigsuspend (set)
   LIBC_CANCEL_RESET (oldtype);
 
   return result;
-#endif
 }
 libc_hidden_def (__sigsuspend)
 weak_alias (__sigsuspend, sigsuspend)
 strong_alias (__sigsuspend, __libc_sigsuspend)
+
+#ifndef NO_CANCELLATION
+int
+__sigsuspend_nocancel (set)
+     const sigset_t *set;
+{
+  return do_sigsuspend (set);
+}
+#endif
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sigsuspend.c b/sysdeps/unix/sysv/linux/sparc/sparc64/sigsuspend.c
deleted file mode 100644 (file)
index 1f06e3d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../ia64/sigsuspend.c"
diff --git a/sysdeps/unix/sysv/linux/x86_64/sigsuspend.c b/sysdeps/unix/sysv/linux/x86_64/sigsuspend.c
deleted file mode 100644 (file)
index 9c5c79e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/ia64/sigsuspend.c>
This page took 0.073386 seconds and 5 git commands to generate.