Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Mar 2010 07:12:44 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r204700 - stable/8/lib/libc/gen
Message-ID:  <201003040712.o247Ci53001951@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Thu Mar  4 07:12:44 2010
New Revision: 204700
URL: http://svn.freebsd.org/changeset/base/204700

Log:
  MFC r204307:
  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.

Modified:
  stable/8/lib/libc/gen/pause.c
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)

Modified: stable/8/lib/libc/gen/pause.c
==============================================================================
--- stable/8/lib/libc/gen/pause.c	Thu Mar  4 07:08:01 2010	(r204699)
+++ stable/8/lib/libc/gen/pause.c	Thu Mar  4 07:12:44 2010	(r204700)
@@ -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()
 {
-	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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003040712.o247Ci53001951>