aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/common
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-01-28 09:08:07 +0000
committerUlrich Drepper <drepper@redhat.com>2003-01-28 09:08:07 +0000
commit772e3426a7b6f5200cb1029d41308b8b666cdbab (patch)
tree7f881f4054beae5b9352ad9771e37ce31dee8b8d /sysdeps/unix/common
parent0566b130fbb77c2673d0459b4d9ff825fc68b094 (diff)
downloadglibc-772e3426a7b6f5200cb1029d41308b8b666cdbab.tar
glibc-772e3426a7b6f5200cb1029d41308b8b666cdbab.tar.gz
glibc-772e3426a7b6f5200cb1029d41308b8b666cdbab.tar.bz2
glibc-772e3426a7b6f5200cb1029d41308b8b666cdbab.zip
Update.
2003-01-28 Ulrich Drepper <drepper@redhat.com> * sysdeps/unix/common/pause.c (do_pause): New function. Split from __libc_pause. Implement using sigsuspend. (__libc_pause): Call do_pause to do the real work. * sysdeps/posix/sigpause.c (do_sigpause): Check range of sig_or_mask parameter is is_sig != 0.
Diffstat (limited to 'sysdeps/unix/common')
-rw-r--r--sysdeps/unix/common/pause.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/sysdeps/unix/common/pause.c b/sysdeps/unix/common/pause.c
index 508a3e0b53..14b87e44d0 100644
--- a/sysdeps/unix/common/pause.c
+++ b/sysdeps/unix/common/pause.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1996, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1996, 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
@@ -22,16 +22,28 @@
/* Suspend the process until a signal arrives.
This always returns -1 and sets errno to EINTR. */
+static void
+do_pause (void)
+{
+ sigset_t set;
+
+ sigemptyset (&set);
+
+ __sigsuspend (&set);
+}
int
__libc_pause (void)
{
if (SINGLE_THREAD_P)
- return __sigpause (__sigblock (0), 0);
+ {
+ do_pause ();
+ return -1;
+ }
int oldtype = LIBC_CANCEL_ASYNC ();
- int result = __sigpause (__sigblock (0), 0);
+ (void) do_pause ();
LIBC_CANCEL_RESET (oldtype);
- return result;
+ return -1;
}
weak_alias (__libc_pause, pause)