466
|
1 <refentry id="signal">
|
|
2 <refnamediv>
|
468
|
3 <refname>Signal</refname>
|
|
4 <refpurpose>catch or ignore interrupts</refpurpose>
|
466
|
5 </refnamediv>
|
|
6
|
|
7 <refsynopsisdiv>
|
|
8 <funcsynopsis>
|
468
|
9 <funcsynopsisinfo>
|
|
10 #include <signal.h>
|
578
|
11
|
|
12 typedef int (*sighandler_t)(int);
|
468
|
13 </funcsynopsisinfo>
|
466
|
14 <funcprototype>
|
578
|
15 <funcdef>sighandler_t <function>signal</function></funcdef>
|
|
16 <paramdef>int <parameter>interrupt</parameter></paramdef>
|
|
17 <paramdef>sighandler_t <parameter>address</parameter></paramdef>
|
|
18
|
466
|
19 </funcprototype>
|
|
20 </funcsynopsis>
|
|
21
|
|
22 </refsynopsisdiv>
|
|
23
|
|
24 <refsect1><title>Description</title>
|
|
25 <para>
|
557
|
26 This call is a comprehensive method of catching or ignoring
|
|
27 signals sent to the current process. Notice that "kill()" does
|
|
28 the sending of signals, and "signal()" does the catching.
|
466
|
29 </para>
|
556
|
30 <para>
|
|
31 The signals used by OS-9 are defined in the header file as
|
|
32 follows:
|
|
33 </para>
|
|
34 <programlisting>
|
|
35 /* OS-9 signals */
|
|
36 #define SIGKILL 0 /* system abort (cannot be caught or ignored)*/
|
|
37 #define SIGWAKE 1 /* wake up */
|
|
38 #define SIGQUIT 2 /* keyboard abort */
|
|
39 #define SIGINT 3 /* keyboard interrupt */
|
|
40
|
|
41 /* special addresses */
|
|
42 #define SIG_DFL 0 /* reset to default */
|
|
43 #define SIG_IGN 1 /* ignore */
|
|
44 </programlisting>
|
|
45 <para>
|
|
46 Please note that there is another method of trapping signals,
|
|
47 namely "intercept()" (q.v.). However, since "signal()" and
|
|
48 "intercept()" are mutually incompatible, calls to both of them
|
|
49 must not appear in the same program. The link-loader will
|
|
50 preven the creation of an executable program in which both are
|
|
51 called by aborting with an "entry name clash" error for
|
|
52 "_sigint".
|
|
53 </para>
|
466
|
54 </refsect1>
|
544
|
55
|
|
56 <refsect1><title>See Also</title>
|
|
57 <para>
|
|
58 <link linkend="intercept">intercept()</link>,
|
|
59 OS-9 shell command "kill",
|
|
60 <link linkend="kill">kill()</link>
|
|
61 </para>
|
|
62 </refsect1>
|
|
63
|
466
|
64 </refentry>
|