/* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. * * %sccs.include.redist.c% */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)abort.c 5.10 (Berkeley) 06/01/90"; #endif /* LIBC_SCCS and not lint */ #include #include #include void abort() { sigset_t mask; sigfillset(&mask); /* * don't block SIGABRT to give any handler a chance; we ignore * any errors -- X311J doesn't allow abort to return anyway. */ sigdelset(&mask, SIGABRT); (void)sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL); (void)kill(getpid(), SIGABRT); /* * if SIGABRT ignored, or caught and the handler returns, do * it again, only harder. */ (void)signal(SIGABRT, SIG_DFL); (void)sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL); (void)kill(getpid(), SIGABRT); exit(1); }