diff options
author | kib <kib@FreeBSD.org> | 2010-02-25 13:51:11 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2010-02-25 13:51:11 +0000 |
commit | e2b46d611bb185c62d8f4cc41b874a385e7916b9 (patch) | |
tree | 5cb86af5bcb3ea540329945329b10efd28b4b251 | |
parent | 009bd804a3a6efaea106b346589016f1da0bd7fe (diff) | |
download | FreeBSD-src-e2b46d611bb185c62d8f4cc41b874a385e7916b9.zip FreeBSD-src-e2b46d611bb185c62d8f4cc41b874a385e7916b9.tar.gz |
Make pause(3) implementation not depended on the legacy sigcompat.c
interfaces. Do not block rt signals during and after pause(3) calls.
Use private libc namespace to call proper methods.
MFC after: 1 week
-rw-r--r-- | lib/libc/gen/pause.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/libc/gen/pause.c b/lib/libc/gen/pause.c index 00bf833..51706cf 100644 --- a/lib/libc/gen/pause.c +++ b/lib/libc/gen/pause.c @@ -33,8 +33,10 @@ static char sccsid[] = "@(#)pause.c 8.1 (Berkeley) 6/4/93"; #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); +#include "namespace.h" #include <signal.h> #include <unistd.h> +#include "un-namespace.h" /* * Backwards compatible pause. @@ -42,7 +44,11 @@ __FBSDID("$FreeBSD$"); int __pause(void) { - return sigpause(sigblock(0L)); + sigset_t oset; + + if (_sigprocmask(SIG_BLOCK, NULL, &oset) == -1) + return (-1); + return (_sigsuspend(&oset)); } __weak_reference(__pause, pause); __weak_reference(__pause, _pause); |