Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2875 dpurdie 1
#pragma force_top_level
2
#pragma include_only_once
3
 
4
/* signal.h: ANSI 'C' (X3J11 Oct 88) library header, section 4.7 */
5
/* Copyright (C) Codemist Ltd., 1988-1993.                       */
6
/* Copyright (C) Advanced Risc Machines Ltd., 1991-1993.         */
7
/* version 0.03 */
8
 
9
/*
10
 * signal.h declares a type and two functions and defines several macros, for
11
 * handling various signals (conditions that may be reported during program
12
 * execution).
13
 */
14
 
15
#ifndef __signal_h
16
#define __signal_h
17
 
18
#ifdef __cplusplus
19
extern "C" {
20
#endif
21
 
22
typedef int sig_atomic_t;
23
   /* type which is the integral type of an object that can be modified as */
24
   /* an atomic entity, even in the presence of asynchronous interrupts. */
25
 
26
extern void __SIG_DFL(int);
27
extern void __SIG_ERR(int);
28
extern void __SIG_IGN(int);
29
   /*
30
    * Each of the following macros expand to a constant expression with a
31
    * distinct value and has the same type as the second argument to, and the
32
    * return value of the signal function, and whose value compares unequal to
33
    * the address of any declarable function.
34
    */
35
#define SIG_DFL &__SIG_DFL
36
#define SIG_ERR &__SIG_ERR
37
#define SIG_IGN &__SIG_IGN
38
 
39
   /*
40
    * Each of the following macros expand to a positive integral constant
41
    * expression that is the signal number corresponding the the specified
42
    * condition.
43
    */
44
#define SIGABRT 1   /* abort                         */
45
#define SIGFPE  2   /* arithmetic exception          */
46
#define SIGILL  3   /* illegal instruction           */
47
#define SIGINT  4   /* attention request from user   */
48
#define SIGSEGV 5   /* bad memory access             */
49
#define SIGTERM 6   /* termination request           */
50
#define SIGSTAK 7   /* stack overflow                */
51
   /* (these following macros are not part of the ANSI standard,
52
    * but private to this implementation
53
    */
54
/* Signal numbers 8 and 9 are available for the user */
55
#define SIGUSR1 8
56
#define SIGUSR2 9
57
#define SIGOSERROR 10
58
 
59
extern void (*signal (int /*sig*/, void (* /*func*/ )(int)))(int);
60
   /*
61
    * Chooses one of three ways in which receipt of the signal number sig is to
62
    * be subsequently handled. If the value of func is SIG_DFL, default
63
    * handling for that signal will occur. If the value of func is SIG_IGN, the
64
    * signal will be ignored. Otherwise func shall point to a function to be
65
    * called when that signal occurs.
66
    * When a signal occurs, if func points to a function, first the equivalent
67
    * of signal(sig, SIG_DFL); is executed. (If the value of sig is SIGILL,
68
    * whether the reset to SIG_DFL occurs is implementation-defined (under
69
    * RISCOS/Arthur/Brazil the reset does occur)). Next the equivalent of
70
    * (*func)(sig); is executed. The function may terminate by calling the
71
    * abort, exit or longjmp function. If func executes a return statement and
72
    * the value of sig was SIGFPE or any other implementation-defined value
73
    * corresponding to a computational exception, the behaviour is undefined.
74
    * Otherwise, the program will resume execution at the point it was
75
    * interrupted.
76
    * If the signal occurs other than as a result of calling the abort or raise
77
    * function, the behaviour is undefined if the signal handler calls any
78
    * function in the standard library other than the signal function itself
79
    * or refers to any object with static storage duration other than by
80
    * assigning a value to a volatile static variable of type sig_atomic_t.
81
    * At program startup, the equivalent of signal(sig, SIG_IGN); may be
82
    * executed for some signals selected in an implementation-defined manner
83
    * (under RISCOS/Arthur/Brazil this does not occur); the equivalent of
84
    * signal(sig, SIG_DFL); is executed for all other signals defined by the
85
    * implementation.
86
    * Returns: If the request can be honoured, the signal function returns the
87
    *          value of func for most recent call to signal for the specified
88
    *          signal sig. Otherwise, a value of SIG_ERR is returned and the
89
    *          integer expression errno is set to indicate the error.
90
    */
91
 
92
extern int raise(int /*sig*/);
93
   /* sends the signal sig to the executing program. */
94
   /* Returns: zero if successful, non-zero if unsuccessful. */
95
 
96
#ifdef __cplusplus
97
}
98
#endif
99
 
100
#endif
101
 
102
/* end of signal.h */