about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2003-02-24 03:51:24 +0000
committerRoland McGrath <roland@gnu.org>2003-02-24 03:51:24 +0000
commit98d8dc64a9b9fc0dbd7af6cf2e4359403aaeb817 (patch)
tree96279a1c9c2b0bd5f8f6eeeb35c2aabb004bcb55
parent5e47b76b5049f2449fc81e873bb87e6d06e3b2ef (diff)
downloadglibc-98d8dc64a9b9fc0dbd7af6cf2e4359403aaeb817.tar.gz
glibc-98d8dc64a9b9fc0dbd7af6cf2e4359403aaeb817.tar.xz
glibc-98d8dc64a9b9fc0dbd7af6cf2e4359403aaeb817.zip
2003-02-23 Roland McGrath <roland@redhat.com>
	* sysdeps/posix/pause.c: New file.
	* sysdeps/unix/common/pause.c: File removed.
-rw-r--r--sysdeps/posix/pause.c (renamed from sysdeps/unix/common/pause.c)29
1 files changed, 9 insertions, 20 deletions
diff --git a/sysdeps/unix/common/pause.c b/sysdeps/posix/pause.c
index 14b87e44d0..db2c54f29d 100644
--- a/sysdeps/unix/common/pause.c
+++ b/sysdeps/posix/pause.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991, 1996, 2002, 2003 Free Software Foundation, Inc.
+/* pause -- suspend the process until a signal arrives.  POSIX.1 version.
+   Copyright (C) 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
@@ -18,32 +19,20 @@
 
 #include <signal.h>
 #include <unistd.h>
-#include <sysdep-cancel.h>
 
 /* Suspend the process until a signal arrives.
    This always returns -1 and sets errno to EINTR.  */
-static void
-do_pause (void)
+int
+__libc_pause (void)
 {
   sigset_t set;
 
-  sigemptyset (&set);
+  __sigemptyset (&set);
+  __sigprocmask (SIG_BLOCK, NULL, &set);
 
-  __sigsuspend (&set);
-}
+  /* pause is a cancellation point, but so is sigsuspend.
+     So no need for anything special here.  */
 
-int
-__libc_pause (void)
-{
-  if (SINGLE_THREAD_P)
-    {
-      do_pause ();
-      return -1;
-    }
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-  (void) do_pause ();
-  LIBC_CANCEL_RESET (oldtype);
-  return -1;
+  return __sigsuspend (&set);
 }
 weak_alias (__libc_pause, pause)