diff options
Diffstat (limited to 'src/stdlib/abort.c')
-rw-r--r-- | src/stdlib/abort.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/stdlib/abort.c b/src/stdlib/abort.c new file mode 100644 index 00000000..d079bdf1 --- /dev/null +++ b/src/stdlib/abort.c @@ -0,0 +1,27 @@ +#include <stdlib.h> +#ifdef _POSIX_SOURCE +#include "sys/types.h" +#endif +#include "signal.h" + +/** cause abnormal program termination **/ + +_Noreturn void abort(void) +{ + raise(SIGABRT); + for(;;); /* silence gcc warning about returning */ +} + +/*** +causes the program to terminate abnormally, unless the +signal CONSTANT(SIGABRT) is caught and the signal handler continues program +execution. +***/ + +/* +IMPLEMENTATION(whether open output streams are flushed) +IMPLEMENTATION(whether open streams are closed) +IMPLEMENTATION(whether temporary files are removed) +IMPLEMENTATION(the value of unsuccessful termination returned to the host environment) +STDC(1) +*/ |