view docs/ccguide/signal.refentry @ 603:e9578f62b346

All refentries finished.
author roug
date Fri, 15 Nov 2002 21:49:51 +0000
parents ed2a3bb12458
children 183184bacb3d
line wrap: on
line source

<refentry id="signal">
<refnamediv>
<refname>Signal</refname>
<refpurpose>catch or ignore interrupts</refpurpose>
</refnamediv>

<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>
#include &lt;signal.h&gt;

typedef int (*sighandler_t)(int);
</funcsynopsisinfo>
<funcprototype>
  <funcdef>sighandler_t <function>signal</function></funcdef>
  <paramdef>int <parameter>interrupt</parameter></paramdef>
  <paramdef>sighandler_t <parameter>address</parameter></paramdef>

</funcprototype>
</funcsynopsis>

</refsynopsisdiv>

<refsect1><title>Description</title>
<para>
This call is a comprehensive method of catching or ignoring
signals sent to the current process. Notice that "kill()" does
the sending of signals, and "signal()" does the catching.
</para>
<para>
The signals used by OS-9 are defined in the header file as
follows:
</para>
<programlisting>
/* OS-9 signals */
#define        SIGKILL 0  /* system abort (cannot be caught or ignored)*/
#define        SIGWAKE 1    /* wake up */
#define        SIGQUIT 2    /* keyboard abort */
#define        SIGINT  3    /* keyboard interrupt */

/* special addresses */
#define        SIG_DFL 0    /* reset to default */
#define        SIG_IGN 1    /* ignore */
</programlisting>
<para>
Please note that there is another method of trapping signals,
namely "intercept()" (q.v.). However, since "signal()" and
"intercept()" are mutually incompatible, calls to both of them
must not appear in the same program. The link-loader will
preven the creation of an executable program in which both are
called by aborting with an "entry name clash" error for
"_sigint".
</para>
</refsect1>

<refsect1><title>See Also</title>
<para>
<link linkend="intercept">intercept()</link>,
OS-9 shell command "kill",
<link linkend="kill">kill()</link>
</para>
</refsect1>

</refentry>