source: trunk/libs/newlib/src/newlib/libc/machine/microblaze/abort.c @ 444

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
Line 
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
7int _dummy_abort = 1;
8
9#else
10
11/*
12FUNCTION
13<<abort>>---abnormal termination of a program
14
15INDEX
16        abort
17
18SYNOPSIS
19        #include <stdlib.h>
20        void abort(void);
21
22DESCRIPTION
23Use <<abort>> to signal that your program has detected a condition it
24cannot deal with.  Normally, <<abort>> ends your program's execution.
25
26Before terminating your program, <<abort>> raises the exception <<SIGABRT>>
27(using `<<raise(SIGABRT)>>').  If you have used <<signal>> to register
28an exception handler for this condition, that handler has the
29opportunity to retain control, thereby avoiding program termination.
30
31In this implementation, <<abort>> does not perform any stream- or
32file-related cleanup (the host environment may do so; if not, you can
33arrange for your program to do its own cleanup with a <<SIGABRT>>
34exception handler).
35
36RETURNS
37<<abort>> does not return to its caller.
38
39PORTABILITY
40ANSI C requires <<abort>>.
41
42Supporting OS subroutines required: <<_exit>> and optionally, <<write>>.
43*/
44
45#include <stdlib.h>
46#include <unistd.h>
47#include <signal.h>
48
49void
50abort (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.