Raise SIGABRT on abort().

* lib/stdlib/abort.c (abort): Raise SIGABRT.
This commit is contained in:
Danny Milosavljevic 2020-06-02 15:02:50 +02:00
parent 55d38162be
commit 4775de0021
No known key found for this signature in database
GPG key ID: E71A35542C30BAA5

View file

@ -18,10 +18,16 @@
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>. * along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <stdlib.h> #include <signal.h>
int __raise(int);
void void
abort (void) abort (void)
{ {
asm ("hlt"); if (__raise(SIGABRT) < 0) { /* could not raise SIGABRT */
/* Fail in any way possible */
unsigned char* x = (unsigned char*) 0;
*x = 2;
}
} }