📄 abort.c
字号:
/* NetWare can not use this implementation of abort. It provides its own version of abort in clib.nlm. If we can not use clib.nlm, then we must write abort in sys/netware. */#ifdef ABORT_PROVIDEDint _dummy_abort = 1;#else/*FUNCTION<<abort>>---abnormal termination of a programINDEX abortANSI_SYNOPSIS #include <stdlib.h> void abort(void);TRAD_SYNOPSIS #include <stdlib.h> void abort();DESCRIPTIONUse <<abort>> to signal that your program has detected a condition itcannot deal with. Normally, <<abort>> ends your program's execution.Before terminating your program, <<abort>> raises the exception <<SIGABRT>>(using `<<raise(SIGABRT)>>'). If you have used <<signal>> to registeran exception handler for this condition, that handler has theopportunity to retain control, thereby avoiding program termination.In this implementation, <<abort>> does not perform any stream- orfile-related cleanup (the host environment may do so; if not, you canarrange for your program to do its own cleanup with a <<SIGABRT>>exception handler).RETURNS<<abort>> does not return to its caller.PORTABILITYANSI C requires <<abort>>.Supporting OS subroutines required: <<_exit>> and optionally, <<write>>.*/#include <stdlib.h>#include <unistd.h>#include <signal.h>_VOID_DEFUN_VOID (abort){#ifdef ABORT_MESSAGE write (2, "Abort called\n", sizeof ("Abort called\n")-1);#endif while (1) { raise (SIGABRT); _exit (1); }}#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -