1 /* tag: Tom Lord Tue Dec  4 14:41:26 2001 (panic-exit.c)
2  */
3 /* panic-exit.c -
4  *
5  ****************************************************************
6  * Copyright (C) 2000 Tom Lord
7  *
8  * See the file "COPYING" for further information about
9  * the copyright and warranty status of this work.
10  */
11 
12 
13 #include "hackerlab/os/unistd.h"
14 #include "hackerlab/os/exit.h"
15 #include "hackerlab/bugs/panic-exit.h"
16 
17 
18 /************************************************************************
19  *(h1 "Exiting Due to Panic"
20  * 	:includes ("hackerlab/bugs/panic-exit.h"))
21  *
22  * |exitting on panic|
23  */
24 
25 /*(c panic_exit)
26  * void panic_exit (void);
27  *
28  * This function is called by `panic' to terminate the process with
29  * status 1.  (It does not return.  It calls `_exit'.)
30  *
31  * For your convenience, this function is defined in its own object
32  * file.  You can define your own version and still link against
33  * this library.  If you do define your own version, *it must not
34  * return*.
35  *
36  */
37 void
panic_exit(void)38 panic_exit (void)
39 {
40   /* Why exit with status 2 instead of EXIT_FAILURE?
41    *
42    * Some programs return information in the exit status and
43    * conventionally statuses 0 and 1 are ordinary returns,
44    * with status 2 indicating an abnormal exit.  `panic_exit' should
45    * be useful in such programs and in forked subprocesses preparing to
46    * `exec' such programs.
47    */
48   _exit (2);
49 }
50