Browse Source

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@
OPENBSD_5_9
guenther 9 years ago
parent
commit
e7906ce8f2
1 changed files with 3 additions and 4 deletions
  1. +3
    -4
      src/lib/libc/stdlib/abort.c

+ 3
- 4
src/lib/libc/stdlib/abort.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: abort.c,v 1.18 2015/09/13 08:31:47 guenther Exp $ */
/* $OpenBSD: abort.c,v 1.19 2015/10/23 04:39:24 guenther Exp $ */
/* /*
* Copyright (c) 1985 Regents of the University of California. * Copyright (c) 1985 Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -34,7 +34,6 @@
#include "thread_private.h" #include "thread_private.h"
#include "atexit.h" #include "atexit.h"
int _thread_sys_sigprocmask(int, const sigset_t *, sigset_t *);
void void
abort(void) abort(void)
@ -48,7 +47,7 @@ abort(void)
* any errors -- X311J doesn't allow abort to return anyway. * any errors -- X311J doesn't allow abort to return anyway.
*/ */
sigdelset(&mask, SIGABRT); sigdelset(&mask, SIGABRT);
(void)_thread_sys_sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL);
(void)sigprocmask(SIG_SETMASK, &mask, NULL);
(void)raise(SIGABRT); (void)raise(SIGABRT);
@ -57,7 +56,7 @@ abort(void)
* it again, only harder. * it again, only harder.
*/ */
(void)signal(SIGABRT, SIG_DFL); (void)signal(SIGABRT, SIG_DFL);
(void)_thread_sys_sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL);
(void)sigprocmask(SIG_SETMASK, &mask, NULL);
(void)raise(SIGABRT); (void)raise(SIGABRT);
_exit(1); _exit(1);
} }


Loading…
Cancel
Save