|
0
|
1 //=========================================================================== |
|
|
2 // |
|
|
3 // abort.cxx |
|
|
4 // |
|
|
5 // Implementation of the abort() function |
|
|
6 // |
|
|
7 //=========================================================================== |
|
|
8 //####COPYRIGHTBEGIN#### |
|
|
9 // |
|
|
10 // ------------------------------------------- |
|
|
11 // The contents of this file are subject to the Cygnus eCos Public License |
|
|
12 // Version 1.0 (the "License"); you may not use this file except in |
|
|
13 // compliance with the License. You may obtain a copy of the License at |
|
|
14 // http://sourceware.cygnus.com/ecos |
|
|
15 // |
|
|
16 // Software distributed under the License is distributed on an "AS IS" |
|
|
17 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the |
|
|
18 // License for the specific language governing rights and limitations under |
|
|
19 // the License. |
|
|
20 // |
|
|
21 // The Original Code is eCos - Embedded Cygnus Operating System, released |
|
|
22 // September 30, 1998. |
|
|
23 // |
|
|
24 // The Initial Developer of the Original Code is Cygnus. Portions created |
|
2
|
25 // by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. |
|
0
|
26 // ------------------------------------------- |
|
|
27 // |
|
|
28 //####COPYRIGHTEND#### |
|
|
29 //=========================================================================== |
|
|
30 //#####DESCRIPTIONBEGIN#### |
|
|
31 // |
|
2
|
32 // Author(s): jlarmour |
|
|
33 // Contributors: jlarmour |
|
|
34 // Date: 1999-02-18 |
|
|
35 // Purpose: Implement the ISO C abort() function from 7.10.4.1 |
|
|
36 // Description: This implements abort() simply by raising SIGABRT as |
|
|
37 // required by ISO C |
|
0
|
38 // Usage: |
|
|
39 // |
|
|
40 //####DESCRIPTIONEND#### |
|
|
41 // |
|
|
42 //=========================================================================== |
|
|
43 |
|
|
44 // CONFIGURATION |
|
|
45 |
|
|
46 #include <pkgconf/libc.h> // Configuration header |
|
|
47 |
|
|
48 // INCLUDES |
|
|
49 |
|
|
50 #include <cyg/infra/cyg_type.h> // Common type definitions and support |
|
|
51 #include <cyg/infra/cyg_trac.h> // Tracing support |
|
|
52 |
|
|
53 #include <stdlib.h> // Header for all stdlib functions |
|
|
54 // (like this one) |
|
2
|
55 #ifdef CYGPKG_LIBC_SIGNALS |
|
|
56 # include <signal.h> |
|
|
57 #endif |
|
0
|
58 |
|
|
59 // FUNCTIONS |
|
|
60 |
|
|
61 externC void |
|
2
|
62 __abort( void ) |
|
0
|
63 { |
|
2
|
64 CYG_REPORT_FUNCNAME( "__abort" ); |
|
|
65 |
|
|
66 #ifdef CYGPKG_LIBC_SIGNALS |
|
|
67 int rc; |
|
|
68 |
|
|
69 rc = raise(SIGABRT); |
|
0
|
70 |
|
2
|
71 CYG_TRACE1(1, "raise(SIGABRT) returned!!! rc=%d", rc); |
|
|
72 |
|
|
73 CYG_FAIL("raise(SIGABRT) returned"); |
|
|
74 |
|
|
75 #endif |
|
|
76 |
|
|
77 // ISO C clearly says that abort() cannot return to its caller |
|
|
78 |
|
0
|
79 // loop forever |
|
|
80 for (;;) |
|
|
81 CYG_EMPTY_STATEMENT; |
|
|
82 |
|
|
83 CYG_REPORT_RETURN(); |
|
|
84 } // abort() |
|
|
85 |
|
2
|
86 // EXPORTED SYMBOLS |
|
0
|
87 |
|
2
|
88 externC void abort(void) CYGBLD_ATTRIB_WEAK_ALIAS(__abort); |
|
0
|
89 |
|
|
90 // EOF abort.cxx |