OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [newlib/] [newlib/] [libc/] [stdlib/] [abort.c] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 39 lampret
/* 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
ANSI_SYNOPSIS
19
        #include <stdlib.h>
20
        void abort(void);
21
 
22
TRAD_SYNOPSIS
23
        #include <stdlib.h>
24
        void abort();
25
 
26
DESCRIPTION
27
Use <<abort>> to signal that your program has detected a condition it
28
cannot deal with.  Normally, <<abort>> ends your program's execution.
29
 
30
Before terminating your program, <<abort>> raises the exception <<SIGABRT>>
31
(using `<<raise(SIGABRT)>>').  If you have used <<signal>> to register
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, <<abort>> does not perform any stream- or
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 <<SIGABRT>>
38
exception handler).
39
 
40
RETURNS
41
<<abort>> does not return to its caller.
42
 
43
PORTABILITY
44
ANSI C requires <<abort>>.
45
 
46
Supporting OS subroutines required: <<getpid>>, <<kill>>.
47
*/
48
 
49
#include <stdlib.h>
50
#include <signal.h>
51
 
52
_VOID
53
_DEFUN_VOID (abort)
54
{
55
#ifdef ABORT_MESSAGE
56
  write (2, "Abort called\n", sizeof ("Abort called\n")-1);
57
#endif
58
 
59
  while (1)
60
    {
61
      raise (SIGABRT);
62
      _exit (1);
63
    }
64
}
65
 
66
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.