summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2003-08-16 11:43:57 +0000
committerdavidxu <davidxu@FreeBSD.org>2003-08-16 11:43:57 +0000
commit8f0c2fc3c422ef31098d14b8705c53715251cc7f (patch)
treed8ea508143066701713f4730306865d82b5fc852 /lib/libc
parent34014d52616ca61b0b5cf0a932b010bfadd29dba (diff)
downloadFreeBSD-src-8f0c2fc3c422ef31098d14b8705c53715251cc7f.zip
FreeBSD-src-8f0c2fc3c422ef31098d14b8705c53715251cc7f.tar.gz
Replace some syscalls with libc version, this makes abort work better with
libkse. Tested under libc_r, libkse, libthr. Reviewed by: deischen
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/stdlib/abort.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/libc/stdlib/abort.c b/lib/libc/stdlib/abort.c
index 2adb081..36cd15b 100644
--- a/lib/libc/stdlib/abort.c
+++ b/lib/libc/stdlib/abort.c
@@ -37,19 +37,16 @@ static char sccsid[] = "@(#)abort.c 8.1 (Berkeley) 6/4/93";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "namespace.h"
#include <signal.h>
#include <stdlib.h>
#include <stddef.h>
#include <unistd.h>
#include <pthread.h>
+#include "un-namespace.h"
void (*__cleanup)();
-/* XXX - why are these declarations here? */
-extern int __sys_sigprocmask(int, const sigset_t *, sigset_t *);
-extern int __sys_sigaction(int, const struct sigaction *,
- struct sigaction *);
-
void
abort()
{
@@ -68,8 +65,8 @@ abort()
* any errors -- ISO C doesn't allow abort to return anyway.
*/
sigdelset(&act.sa_mask, SIGABRT);
- (void)__sys_sigprocmask(SIG_SETMASK, &act.sa_mask, NULL);
- (void)kill(getpid(), SIGABRT);
+ (void)_sigprocmask(SIG_SETMASK, &act.sa_mask, NULL);
+ (void)raise(SIGABRT);
/*
* If SIGABRT was ignored, or caught and the handler returns, do
@@ -78,9 +75,9 @@ abort()
act.sa_handler = SIG_DFL;
act.sa_flags = 0;
sigfillset(&act.sa_mask);
- (void)__sys_sigaction(SIGABRT, &act, NULL);
+ (void)_sigaction(SIGABRT, &act, NULL);
sigdelset(&act.sa_mask, SIGABRT);
- (void)__sys_sigprocmask(SIG_SETMASK, &act.sa_mask, NULL);
- (void)kill(getpid(), SIGABRT);
+ (void)_sigprocmask(SIG_SETMASK, &act.sa_mask, NULL);
+ (void)raise(SIGABRT);
exit(1);
}
OpenPOWER on IntegriCloud