Rev 4874 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4349 | Serge | 1 | /* NetWare can not use this implementation of abort. It provides its |
2 | own version of abort in clib.nlm. If we can not use clib.nlm, then |
||
3 | we must write abort in sys/netware. */ |
||
4 | |||
5 | #ifdef ABORT_PROVIDED |
||
6 | |||
7 | int _dummy_abort = 1; |
||
8 | |||
9 | #else |
||
10 | |||
11 | /* |
||
12 | FUNCTION |
||
13 | < |
||
14 | |||
15 | INDEX |
||
16 | abort |
||
17 | |||
18 | ANSI_SYNOPSIS |
||
19 | #include |
||
20 | void abort(void); |
||
21 | |||
22 | TRAD_SYNOPSIS |
||
23 | #include |
||
24 | void abort(); |
||
25 | |||
26 | DESCRIPTION |
||
27 | Use < |
||
28 | cannot deal with. Normally, < |
||
29 | |||
30 | Before terminating your program, < |
||
31 | (using `< |
||
32 | an exception handler for this condition, that handler has the |
||
33 | opportunity to retain control, thereby avoiding program termination. |
||
34 | |||
35 | In this implementation, < |
||
36 | file-related cleanup (the host environment may do so; if not, you can |
||
37 | arrange for your program to do its own cleanup with a < |
||
38 | exception handler). |
||
39 | |||
40 | RETURNS |
||
41 | < |
||
42 | |||
43 | PORTABILITY |
||
44 | ANSI C requires < |
||
45 | |||
46 | Supporting OS subroutines required: <<_exit>> and optionally, < |
||
47 | */ |
||
48 | |||
49 | #include |
||
50 | #include |
||
51 | #include |
||
52 | |||
53 | _VOID |
||
54 | _DEFUN_VOID (abort) |
||
55 | { |
||
56 | #ifdef ABORT_MESSAGE |
||
57 | write (2, "Abort called\n", sizeof ("Abort called\n")-1); |
||
58 | #endif |
||
59 | |||
60 | while (1) |
||
61 | { |
||
4921 | Serge | 62 | raise (SIGABRT); |
4349 | Serge | 63 | _exit (1); |
64 | } |
||
65 | } |
||
66 | |||
67 | #endif |