summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2001-09-04 23:35:57 +0000
committermillert <millert@openbsd.org>2001-09-04 23:35:57 +0000
commit9a7fa6a3bae31e414517a8c0f42be17b33cbbdde (patch)
tree000cb82ab8dd6c4281507d04c77945ba5fb9f0d5 /lib/libc/gen
parentUse _waitq_remove() and _waitq_insert() always; from FreeBSD. (diff)
downloadwireguard-openbsd-9a7fa6a3bae31e414517a8c0f42be17b33cbbdde.tar.xz
wireguard-openbsd-9a7fa6a3bae31e414517a8c0f42be17b33cbbdde.zip
Replace the deprecated BSD sigsetmask/sigblock/sigpause functions with their POSIX counterparts.
Diffstat (limited to 'lib/libc/gen')
-rw-r--r--lib/libc/gen/pause.c42
1 files changed, 8 insertions, 34 deletions
diff --git a/lib/libc/gen/pause.c b/lib/libc/gen/pause.c
index 489817d887b..c7fc83c0a67 100644
--- a/lib/libc/gen/pause.c
+++ b/lib/libc/gen/pause.c
@@ -1,49 +1,23 @@
+/* $OpenBSD: pause.c,v 1.3 2001/09/04 23:35:58 millert Exp $ */
+
/*
- * Copyright (c) 1983, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * Written by Todd C. Miller <Todd.Miller@courtesan.com>
+ * Public domain.
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: pause.c,v 1.2 1996/08/19 08:25:16 tholo Exp $";
+static const char rcsid[] = "$OpenBSD: pause.c,v 1.3 2001/09/04 23:35:58 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <signal.h>
-#include <unistd.h>
/*
- * Backwards compatible pause.
+ * Backwards compatible pause(3).
*/
int
pause()
{
+ sigset_t mask;
- return sigpause(sigblock(0L));
+ return (sigprocmask(SIG_BLOCK, NULL, &mask) ? -1 : sigsuspend(&mask));
}