1LAM_KSIGNAL(2)                 LAM LOCAL LIBRARY                LAM_KSIGNAL(2)
2
3
4

NAME

6       lam_ksignal - Specify a signal handler for a LAM signal.
7

SYNOPSIS

9       #include <lam_ksignal.h>
10
11       void (*lam_ksignal (int signum, void (*func)())) ();
12

DESCRIPTION

14       lam_ksignal()  exchanges a current signal handler for a new signal han‐
15       dler.  When a process is signalled, execution  control  passes  immedi‐
16       ately  to  the  handler  function.  Control passes back to the previous
17       location when the handler function returns.  Each signal begins with  a
18       default handler when the process is initialized.
19
20       LAM  signals  are completely separate from the signal facilities of the
21       host operating system.  While the syntax and functionality are similar,
22       signal(3) cannot affect LAM signals and vice versa.
23
24       The  following  is  a  list of LAM signals as they appear in <lam_ksig‐
25       nal.h>.
26
27       LAM_SIGTRACE   1    unload trace data
28       LAM_SIGUDIE    4    terminate
29       LAM_SIGARREST  5    suspend execution
30       LAM_SIGRELEASE 6    continue execution
31       LAM_SIGA       7    user defined
32       LAM_SIGB       8    user defined
33       LAM_SIGFUSE    9    node about to die
34       LAM_SIGSHRINK  10   another node has died
35
36       By default, LAM_SIGA and LAM_SIGB are ignored.  They are  reserved  for
37       application  programmers  LAM_SIGUDIE  causes  the signalled process to
38       exit.  LAM_SIGARREST causes the signalled process to indefinitely block
39       and LAM_SIGRELEASE reschedules it.
40
41       LAM_SIGTRACE  causes  the  current  contents  of the trace buffer to be
42       flushed to the local trace daemon.
43
44       LAM_SIGFUSE and LAM_SIGSHRINK are fault tolerant signals.   The  former
45       indicates  that  the  local  node  and all its processes will terminate
46       imminently.  The process receiving LAM_SIGFUSE  should  take  immediate
47       action to clean up.  By default, LAM_SIGFUSE is ignored.  LAM_SIGSHRINK
48       indicates that another node has died  or  been  forcefully  terminated.
49       The  default  action  is  to  flush  the route cache so that subsequent
50       remote service calls to the dead node will fail with EBADNODE (in <ter‐
51       ror.h>).   If  the  application decides to trap this signal, the signal
52       handler should call the old handler (the default which will be returned
53       by lam_ksignal()) before returning.
54
55       The  new signal handler must be the address of a function.  The special
56       value LAM_KSIG_IGN ignores the given signal.   (A  function  that  does
57       nothing  is  called  when  the  signal occurs.)  Another special value,
58       LAM_KSIG_DFL, returns the signal handler to the default function.
59
60       When a signal handler is called, the  signal  number  that  caused  the
61       invocation is passed as the sole parameter to the handler.
62
63       While  an signal handler is running, further signals on the same number
64       are blocked.  Interrupts do not form  queues.   A  second  signal  will
65       overwrite  the  first (thus two appear as one) if the first has not yet
66       been handled, either due to scheduling or signal blocking.
67

RETURN VALUE

69       Upon successful completion, the address  of  the  previously  installed
70       signal handler, which may be reinstated later, is returned.  Otherwise,
71       -1 is returned and the global variable errno is  set  to  indicate  the
72       error.
73

ERRORS

75       EINVAL         The signal number is invalid or privileged.
76

SEE ALSO

78       MPIL_Signal(2), lam_ksigblock(2)
79
80
81
82LAM 7.1.2                         March, 2006                   LAM_KSIGNAL(2)
Impressum