X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/9385eb3d10ebe5eb398c52040ec3dbfba9b0cdcf..aa54d2fad3d9038b43475aa93c76795c5141a993:/gen/FreeBSD/pause.c?ds=inline diff --git a/gen/FreeBSD/pause.c b/gen/FreeBSD/pause.c index 4f56289..2cb962c 100644 --- a/gen/FreeBSD/pause.c +++ b/gen/FreeBSD/pause.c @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. @@ -31,11 +27,16 @@ * SUCH DAMAGE. */ +#if defined(VARIANT_CANCELABLE) && __DARWIN_NON_CANCELABLE != 0 +#error cancellable call vs. __DARWIN_NON_CANCELABLE mismatch +#endif + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)pause.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ + #include -__FBSDID("$FreeBSD: src/lib/libc/gen/pause.c,v 1.6 2002/02/01 00:57:29 obrien Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/gen/pause.c,v 1.8 2009/12/05 19:31:38 ed Exp $"); #include #include @@ -44,9 +45,12 @@ __FBSDID("$FreeBSD: src/lib/libc/gen/pause.c,v 1.6 2002/02/01 00:57:29 obrien Ex * Backwards compatible pause. */ int -__pause() +__pause(void) { - return sigpause(sigblock(0L)); + sigset_t set; + + sigprocmask(0, NULL, &set); + return sigsuspend(&set); } __weak_reference(__pause, pause); __weak_reference(__pause, _pause);