svn commit: r204307 - head/lib/libc/gen

Konstantin Belousov kib at FreeBSD.org
Thu Feb 25 13:51:12 UTC 2010


Author: kib
Date: Thu Feb 25 13:51:11 2010
New Revision: 204307
URL: http://svn.freebsd.org/changeset/base/204307

Log:
  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

Modified:
  head/lib/libc/gen/pause.c

Modified: head/lib/libc/gen/pause.c
==============================================================================
--- head/lib/libc/gen/pause.c	Thu Feb 25 13:28:05 2010	(r204306)
+++ head/lib/libc/gen/pause.c	Thu Feb 25 13:51:11 2010	(r204307)
@@ -33,8 +33,10 @@ static char sccsid[] = "@(#)pause.c	8.1 
 #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);


More information about the svn-src-all mailing list