Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ sigaction(2) — DG/UX 4.30

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

kill(2)

sigprocmask(2)

sigsetops(3)

sigsuspend(2)



     sigaction(2)               DG/UX 4.30                sigaction(2)



     NAME
          sigaction - Examine and change signal action.

     SYNOPSIS
          #include <signal.h>

          int sigaction (sig, act, oact)
          int sig;
          struct sigaction *act, *oact;

     DESCRIPTION
          The sigaction() function allows the calling process to
          examine or specify (or both) the action to be associated
          with a specific signal.  The argument sig specifies the
          signal; acceptable values are defined in <signal.h>.

          The structure sigaction, used to describe an action to be
          taken, is defined in the header <signal.h> to include at
          least the following members:

             Member         Member
              Type           Name                Description

          void (*)()     sa_handler     SIG_DFL, SIG_IGN, or pointer
                                        to a function.

          sigset_t       sa_mask        Additional set of signals to
                                        be blocked during execution of
                                        signal-catching function.

          int            sa_flags       Special flags to affect
                                        behavior of signal.

          If the argument act is not NULL, it points to a structure
          specifying the action to be associated with the specified
          signal.  If the argument oact is not NULL the action
          previously associated with the signal is stored in the
          location pointed to by the argument oact.  If the argument
          act is NULL signal handling is unchanged by this function
          call; thus, the call can be used to enquire about the
          current handling of a given signal.  The sa_handler field of
          the sigaction structure identifies the action to be
          associated with the specified signal.  If the sa_handler
          field specifies a signal-catching function, the sa_mask
          field identifies a set of signals that shall be added to the
          process's signal mask before the signal-catching function is
          invoked.  The SIGKILL and SIGSTOP signals shall not be added
          to the signal mask using this mechanism; this restriction
          shall be enforced by the system without causing an error to
          be indicated.

          The sa_flags field can be used to modify the behavior of the



     Licensed material--property of copyright holder(s)         Page 1





     sigaction(2)               DG/UX 4.30                sigaction(2)



          specified signal.

          The following flag bit, defined in the header <signal.h>,
          can be set in sa_flags:

             Symbolic
             Constant                    Description

           SA_NOCLDSTOP   Do not generate SIGCHLD when children stop

          If sig is SIGCHLD and the SA_NOCLDSTOP flag is not set in
          sa_flags, and the implementation supports the SIGCHLD
          signal, a SIGCHLD signal shall be generated for the calling
          process whenever any of its child processes stop.  If sig is
          SIGCHLD and the SA_NOCLDSTOP flag is set in sa_flags, the
          implementation shall not generate a SIGCHLD signal in this
          way.

          When a signal is caught by a signal-catching function
          installed by the sigaction() function, a new signal mask is
          calculated and installed for the duration of the signal-
          catching function (or until a call to either the
          sigprocmask() or sigsuspend() function is made).  This mask
          is formed by taking the union of the current signal mask and
          the value of the sa_mask for the signal being delivered, and
          then including the signal being delivered.  If and when the
          user's signal handler returns normally, the original signal
          mask is restored.

          Once an action is installed for a specific signal, it
          remains installed until another action is explicitly
          requested (by another call to the sigaction() function), or
          until one of the exec() functions is called.

          If the previous action for sig had been established by the
          signal() function, defined in the C Standard, the values of
          the fields returned in the structure pointed to by oact are
          unspecified, and in particular oact->sv_handler is not
          necessarily the same value passed to the signal() function.
          However, if a pointer to the same structure or a copy
          thereof is passed to a subsequent call to the sigaction()
          function via the act argument, handling of the signal shall
          be as if the original call to the signal() function were
          repeated.

          If the sigaction() function fails, no new signal handler is
          installed.

     RETURNS
          Upon successful completion a value of zero is returned.
          Otherwise, a value of -1 is returned and errno is set to
          indicate the error.



     Licensed material--property of copyright holder(s)         Page 2





     sigaction(2)               DG/UX 4.30                sigaction(2)



     ERRORS
          If any of the following conditions occur, the sigaction()
          function shall return -1 and set errno to the corresponding
          value:

          [EINVAL]
               The value of the sig argument is an invalid or
               unsupported signal number, or an attempt was made to
               catch a signal that cannot be caught or to ignore a
               signal that cannot be ignored.  See <signal.h>.

     SEE ALSO
          kill(2), <signal.h>, sigprocmask(2), sigsetops(3),
          sigsuspend(2)

     COPYRIGHTS
          Portions of this text are reprinted from IEEE Std 1003.1-
          1988, Portable Operating System Interface for Computer
          Environment, copyright © 1988 by the Institute of Electrical
          and Electronics Engineers, Inc., with the permission of the
          IEEE Standards Department.  To purchase IEEE Standards, call
          800/678-IEEE.

          In the event of a discrepancy between the electronic and the
          original printed version, the original version takes
          precedence.





























     Licensed material--property of copyright holder(s)         Page 3



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026