Last change
on this file since 444 was
444,
checked in by satin@…, 6 years ago
|
add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc
|
File size:
1.4 KB
|
Rev | Line | |
---|
[444] | 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 | <<abort>>---abnormal termination of a program |
---|
| 14 | |
---|
| 15 | INDEX |
---|
| 16 | abort |
---|
| 17 | |
---|
| 18 | SYNOPSIS |
---|
| 19 | #include <stdlib.h> |
---|
| 20 | void abort(void); |
---|
| 21 | |
---|
| 22 | DESCRIPTION |
---|
| 23 | Use <<abort>> to signal that your program has detected a condition it |
---|
| 24 | cannot deal with. Normally, <<abort>> ends your program's execution. |
---|
| 25 | |
---|
| 26 | Before terminating your program, <<abort>> raises the exception <<SIGABRT>> |
---|
| 27 | (using `<<raise(SIGABRT)>>'). If you have used <<signal>> to register |
---|
| 28 | an exception handler for this condition, that handler has the |
---|
| 29 | opportunity to retain control, thereby avoiding program termination. |
---|
| 30 | |
---|
| 31 | In this implementation, <<abort>> does not perform any stream- or |
---|
| 32 | file-related cleanup (the host environment may do so; if not, you can |
---|
| 33 | arrange for your program to do its own cleanup with a <<SIGABRT>> |
---|
| 34 | exception handler). |
---|
| 35 | |
---|
| 36 | RETURNS |
---|
| 37 | <<abort>> does not return to its caller. |
---|
| 38 | |
---|
| 39 | PORTABILITY |
---|
| 40 | ANSI C requires <<abort>>. |
---|
| 41 | |
---|
| 42 | Supporting OS subroutines required: <<_exit>> and optionally, <<write>>. |
---|
| 43 | */ |
---|
| 44 | |
---|
| 45 | #include <stdlib.h> |
---|
| 46 | #include <unistd.h> |
---|
| 47 | #include <signal.h> |
---|
| 48 | |
---|
| 49 | void |
---|
| 50 | abort (void) |
---|
| 51 | { |
---|
| 52 | #ifdef ABORT_MESSAGE |
---|
| 53 | write (2, "Abort called\n", sizeof ("Abort called\n")-1); |
---|
| 54 | #endif |
---|
| 55 | |
---|
| 56 | while (1) |
---|
| 57 | { |
---|
| 58 | exit(1); |
---|
| 59 | } |
---|
| 60 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.