summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/abort.c
diff options
context:
space:
mode:
authorguenther <>2015-10-23 04:39:24 +0000
committerguenther <>2015-10-23 04:39:24 +0000
commit0318167b7689b32eb9d5c7f8d5de7eada56299b7 (patch)
treec03c5fcb25ad2078365518e9089e736909cc59ae /src/lib/libc/stdlib/abort.c
parent3dd284a67fd444a40f7de3ef07b8d29b0dfc6e78 (diff)
downloadopenbsd-0318167b7689b32eb9d5c7f8d5de7eada56299b7.tar.gz
openbsd-0318167b7689b32eb9d5c7f8d5de7eada56299b7.tar.bz2
openbsd-0318167b7689b32eb9d5c7f8d5de7eada56299b7.zip
Merge the sigaction() and sigprocmask() overloads/wrappers from libpthread
into libc, and move pthread_sigmask() as well (just a trivial wrapper). This provides consistent handling of SIGTHR between single- and multi-threaded programs and is a step in the merge of all the libpthread overloads, providing some ASM and Makefile bits that the other wrappers will need. ok deraadt@ millert@
Diffstat (limited to 'src/lib/libc/stdlib/abort.c')
-rw-r--r--src/lib/libc/stdlib/abort.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/libc/stdlib/abort.c b/src/lib/libc/stdlib/abort.c
index 903bfa78e1..710cd7da47 100644
--- a/src/lib/libc/stdlib/abort.c
+++ b/src/lib/libc/stdlib/abort.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: abort.c,v 1.18 2015/09/13 08:31:47 guenther Exp $ */ 1/* $OpenBSD: abort.c,v 1.19 2015/10/23 04:39:24 guenther Exp $ */
2/* 2/*
3 * Copyright (c) 1985 Regents of the University of California. 3 * Copyright (c) 1985 Regents of the University of California.
4 * All rights reserved. 4 * All rights reserved.
@@ -34,7 +34,6 @@
34#include "thread_private.h" 34#include "thread_private.h"
35#include "atexit.h" 35#include "atexit.h"
36 36
37int _thread_sys_sigprocmask(int, const sigset_t *, sigset_t *);
38 37
39void 38void
40abort(void) 39abort(void)
@@ -48,7 +47,7 @@ abort(void)
48 * any errors -- X311J doesn't allow abort to return anyway. 47 * any errors -- X311J doesn't allow abort to return anyway.
49 */ 48 */
50 sigdelset(&mask, SIGABRT); 49 sigdelset(&mask, SIGABRT);
51 (void)_thread_sys_sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL); 50 (void)sigprocmask(SIG_SETMASK, &mask, NULL);
52 51
53 (void)raise(SIGABRT); 52 (void)raise(SIGABRT);
54 53
@@ -57,7 +56,7 @@ abort(void)
57 * it again, only harder. 56 * it again, only harder.
58 */ 57 */
59 (void)signal(SIGABRT, SIG_DFL); 58 (void)signal(SIGABRT, SIG_DFL);
60 (void)_thread_sys_sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL); 59 (void)sigprocmask(SIG_SETMASK, &mask, NULL);
61 (void)raise(SIGABRT); 60 (void)raise(SIGABRT);
62 _exit(1); 61 _exit(1);
63} 62}