diff options
author | David Leonard <d@cvs.openbsd.org> | 1998-11-20 11:19:02 +0000 |
---|---|---|
committer | David Leonard <d@cvs.openbsd.org> | 1998-11-20 11:19:02 +0000 |
commit | f547068f88348f54941dc06da46491f99701933e (patch) | |
tree | 8548a6b78719cba1de575b7f49e5f8ac4e6f1683 /lib/libc/stdlib/abort.c | |
parent | 394c7a9821726b84f284c0c4385b1a9198afa0b0 (diff) |
Add thread-safety to libc, so that libc_r will build (on i386 at least).
All POSIX libc api now there (to P1003.1c/D10)
(more md stuff is needed for other libc/arch/*)
(setlogin is no longer a special syscall)
Add -pthread option to gcc (that makes it use -lc_r and -D_POSIX_THREADS).
Doc some re-entrant routines
Add libc_r to intro(3)
dig() uses some libc srcs and an extra -I was needed there.
Add more md stuff to libc_r.
Update includes for the pthreads api
Update libc_r TODO
Diffstat (limited to 'lib/libc/stdlib/abort.c')
-rw-r--r-- | lib/libc/stdlib/abort.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/libc/stdlib/abort.c b/lib/libc/stdlib/abort.c index 4ea8a2ca4b7..4cc6257acb9 100644 --- a/lib/libc/stdlib/abort.c +++ b/lib/libc/stdlib/abort.c @@ -32,12 +32,13 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: abort.c,v 1.5 1997/06/22 20:21:25 tholo Exp $"; +static char *rcsid = "$OpenBSD: abort.c,v 1.6 1998/11/20 11:18:49 d Exp $"; #endif /* LIBC_SCCS and not lint */ #include <signal.h> #include <stdlib.h> #include <unistd.h> +#include "thread_private.h" void (*__cleanup)(); @@ -54,7 +55,11 @@ abort() * any errors -- X311J doesn't allow abort to return anyway. */ sigdelset(&mask, SIGABRT); +#ifdef _THREAD_SAFE + (void)_thread_sys_sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL); +#else _THREAD_SAFE (void)sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL); +#endif _THREAD_SAFE /* * POSIX requires we flush stdio buffers on abort @@ -71,7 +76,11 @@ abort() * it again, only harder. */ (void)signal(SIGABRT, SIG_DFL); +#ifdef _THREAD_SAFE + (void)_thread_sys_sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL); +#else _THREAD_SAFE (void)sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL); +#endif _THREAD_SAFE (void)kill(getpid(), SIGABRT); exit(1); } |