Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libc / stdlib / abort.c
blob065dee5b6c710102420d91139434e5fd0897838a
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. */
5 #ifdef ABORT_PROVIDED
7 int _dummy_abort = 1;
9 #else
12 FUNCTION
13 <<abort>>---abnormal termination of a program
15 INDEX
16 abort
18 SYNOPSIS
19 #include <stdlib.h>
20 void abort(void);
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.
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.
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).
36 RETURNS
37 <<abort>> does not return to its caller.
39 PORTABILITY
40 ANSI C requires <<abort>>.
42 Supporting OS subroutines required: <<_exit>> and optionally, <<write>>.
45 #include <stdlib.h>
46 #include <unistd.h>
47 #include <signal.h>
49 void
50 abort (void)
52 #ifdef ABORT_MESSAGE
53 write (2, "Abort called\n", sizeof ("Abort called\n")-1);
54 #endif
56 while (1)
58 raise (SIGABRT);
59 _exit (1);
63 #endif