HP 3000 Manuals

Signals [ MPE/iX Developer's Kit Reference Manual Volume I ] MPE/iX 5.0 Documentation


MPE/iX Developer's Kit Reference Manual Volume I

Signals 

This section provides an overview of implementation considerations that
you must understand when using signals as they are implemented in the
POSIX/iX library.  For more information about how signals are used in a
POSIX.1 environment, refer to chapter 5, "Signals", in The POSIX.1 
Standard - A Programmer's Guide (36430-90003).

Supported Signal Functions 

All signal functions defined by the POSIX.1 standard are implemented in
the POSIX/iX library.  While the ANSI C functions signal() and raise()
are provided in the POSIX/iX library, they are not part of the POSIX.1
standard.  A strictly conforming POSIX application should not use them.

Signal Descriptions 

Table 3-5  describes the signal constants declared in the <signal.h>
header that are used by a process to refer to the signals that occur on
the system.  Also noted are the default action taken by the system when
the signal is delivered, whether the signal is required for POSIX.1
conformance, and any MPE/iX implementation details.

          Table 3-5.  POSIX/iX Signals 

----------------------------------------------------------------------------------------------
|              |              |                                                              |
|   Constant   |   Default    |            Description and Implementation Details            |
|              |    Action    |                                                              |
|              |              |                                                              |
----------------------------------------------------------------------------------------------
|              |              |                                                              |
| SIGABRT      | Abnormal     | Abnormal termination signal (initiated by the abort()        |
|              | termination  | function).                                                   |
|              |              | Required for POSIX.1 conformance.                            |
|              |              |                                                              |
----------------------------------------------------------------------------------------------
|              |              |                                                              |
| SIGALRM      | Abnormal     | Timeout signal (initiated by the alarm() function).          |
|              | termination  | Required for POSIX.1 conformance.                            |
|              |              |                                                              |
----------------------------------------------------------------------------------------------
|              |              |                                                              |
| SIGBUS       | Abnormal     | Address violation.  SIGBUS is not required for POSIX.1       |
|              | termination  | conformance, but is a signal commonly used on UNIX(TM)-based |
|              |              | systems.  A POSIX.1-conforming application should not rely   |
|              |              | upon the generation of this signal by the system.  The       |
|              |              | results are undefined if the system generates this signal    |
|              |              | while the signal is either blocked, ignored, or has a        |
|              |              | signal-handling function that returns normally.              |
|              |              |                                                              |
----------------------------------------------------------------------------------------------
|              |              |                                                              |
| SIGFPE       | Abnormal     | Erroneous arithmetic operation, such as division by zero or  |
|              | termination  | a floating-point exception.  The results are undefined if    |
|              |              | the system generates this signal while the signal is either  |
|              |              | blocked, ignored, or has a signal-handling function that     |
|              |              | returns normally.                                            |
|              |              | Required for POSIX.1 conformance.                            |
|              |              |                                                              |
----------------------------------------------------------------------------------------------
|              |              |                                                              |
| SIGHUP       | Abnormal     | Hang-up detected on a controlling terminal or death of a     |
|              | termination  | controlling process.                                         |
|              |              | Required for POSIX.1 conformance.                            |
|              |              |                                                              |
----------------------------------------------------------------------------------------------
|              |              |                                                              |
| SIGILL       | Abnormal     | Detection of an invalid or illegal hardware instruction (not |
|              | termination  | reset when caught).                                          |
|              |              | Required for POSIX.1 conformance.                            |
|              |              |                                                              |
----------------------------------------------------------------------------------------------
|              |              |                                                              |
| SIGINT       | Abnormal     | Interactive interrupt signal.                                |
|              | termination  | Required for POSIX.1 conformance.                            |
|              |              |                                                              |
----------------------------------------------------------------------------------------------

          Table 3-5.  POSIX/iX Signals (cont.) 

----------------------------------------------------------------------------------------------
|              |              |                                                              |
|   Constant   |   Default    |            Description and Implementation Details            |
|              |    Action    |                                                              |
|              |              |                                                              |
----------------------------------------------------------------------------------------------
|              |              |                                                              |
| SIGKILL      | Abnormal     | Termination signal (cannot be caught or ignored).  If an     |
|              | termination  | application attempts to change the default action associated |
|              |              | with SIGKILL, the attempt is ignored without error.          |
|              |              | Required for POSIX.1 conformance.                            |
|              |              |                                                              |
----------------------------------------------------------------------------------------------
|              |              |                                                              |
| SIGPIPE      | Abnormal     | Write on a pipe with no readers.                             |
|              | termination  | Required for POSIX.1 conformance.                            |
|              |              |                                                              |
----------------------------------------------------------------------------------------------
|              |              |                                                              |
| SIGPOLL      | Ignore       | Streams poll signal.  Also known as SIGIO.                   |
|              |              |                                                              |
----------------------------------------------------------------------------------------------
|              |              |                                                              |
| SIGQUIT      | Abnormal     | Interactive termination signal.                              |
|              | termination  | Required for POSIX.1 conformance.                            |
|              |              |                                                              |
----------------------------------------------------------------------------------------------
|              |              |                                                              |
| SIGSEGV      | Abnormal     | Detection of an invalid or illegal memory reference.  The    |
|              | termination  | results are undefined if the system generates this signal    |
|              |              | while the signal is either blocked, ignored, or has a        |
|              |              | signal-handling function that returns normally.              |
|              |              | Required for POSIX.1 conformance.                            |
|              |              |                                                              |
----------------------------------------------------------------------------------------------
|              |              |                                                              |
| SIGTERM      | Abnormal     | Software termination signal (initiated by the kill()         |
|              | termination  | function).                                                   |
|              |              | Required for POSIX.1 conformance.                            |
|              |              |                                                              |
----------------------------------------------------------------------------------------------
|              |              |                                                              |
| SIGURG       | Ignore       | Urgent condition in I/O channel.                             |
|              |              |                                                              |
----------------------------------------------------------------------------------------------
|              |              |                                                              |
| SIGUSR1      | Abnormal     | Reserved as application-defined signal #1.                   |
|              | termination  | Required for POSIX.1 conformance.                            |
|              |              |                                                              |
----------------------------------------------------------------------------------------------
|              |              |                                                              |
| SIGUSR2      | Abnormal     | Reserved as application-defined signal #2.                   |
|              | termination  | Required for POSIX.1 conformance.                            |
|              |              |                                                              |
----------------------------------------------------------------------------------------------

          Table 3-5.  POSIX/iX Signals (cont.) 

----------------------------------------------------------------------------------------------
|              |              |                                                              |
|   Constant   |   Default    |            Description and Implementation Details            |
|              |    Action    |                                                              |
|              |              |                                                              |
----------------------------------------------------------------------------------------------
|                                                                                            |
| Job Control Signals                                                                        |
|                                                                                            |
----------------------------------------------------------------------------------------------
|              |              |                                                              |
| SIGCHLD      | Ignore the   | Child process stopped or terminated.                         |
|              | signal       | Required for POSIX.1 conformance.                            |
|              |              |                                                              |
----------------------------------------------------------------------------------------------
|              |              |                                                              |
| SIGCONT      | Continue if  | Continue if stopped.  This signal is never generated by the  |
|              | stopped;     | system.                                                      |
|              | otherwise,   | Required for POSIX.1 conformance.                            |
|              | ignore       |                                                              |
|              |              |                                                              |
----------------------------------------------------------------------------------------------
|              |              |                                                              |
| SIGSTOP      | Stop the     | Stop signal (cannot be caught or ignored).  If an            |
|              | process      | application attempts to change the default action associated |
|              |              | with SIGSTOP, the attempt is ignored without error.  This    |
|              |              | signal is never generated by the system.                     |
|              |              | Required for POSIX.1 conformance.                            |
|              |              |                                                              |
----------------------------------------------------------------------------------------------
|              |              |                                                              |
| SIGTSTP      | Stop the     | Interactive stop signal.  Because job control is not         |
|              | process      | currently implemented, your application should not rely upon |
|              |              | the generation of this signal by the system.                 |
|              |              | Required for POSIX.1 conformance.                            |
|              |              |                                                              |
----------------------------------------------------------------------------------------------
|              |              |                                                              |
| SIGTTIN      | Stop the     | Read from the controlling terminal attempted by a member of  |
|              | process      | a background process group.  Because job control is not      |
|              |              | currently implemented, your application should not rely upon |
|              |              | the generation of this signal by the system.                 |
|              |              | Required for POSIX.1 conformance.                            |
|              |              |                                                              |
----------------------------------------------------------------------------------------------
|              |              |                                                              |
| SIGTTOU      | Stop the     | Write to the controlling terminal attempted by a member of a |
|              | process      | background process group.  Because job control is not        |
|              |              | currently implemented, your application should not rely upon |
|              |              | the generation of this signal by the system.                 |
|              |              | Required for POSIX.1 conformance.                            |
|              |              |                                                              |
----------------------------------------------------------------------------------------------

Additional Implementation Considerations 

On MPE/iX, signals cannot be delivered to a process while that process is
executing system code.  The signal remains pending until control returns
to the calling process.  A sending process cannot rely on timely delivery
of a signal if the target process is executing system code.  For example,
if a signal is generated for a process when the process is executing a
call to read() or write(), the signal remains pending until the function
call returns either after successful transfer of data or when an error is
encountered.

The ANSI C signal() function is implemented in the POSIX/iX library as a
call to sigaction(); however, the signal() function is considered by the
POSIX.1 standard to be incompatible with the POSIX.1 sigaction()
function.  A strictly conforming POSIX.1 application must not use the
signal() function.

The sigaction() function can return and reinstall a signal action that
was originally installed by signal(); however, the structure that
sigaction() returns in oact cannot be reliably examined by the calling
process.  If this same signal action is later reinstalled, without
modification, by another call to sigaction(), the result is as if the
original call to signal() were repeated.

If multiple occurrences of a signal are generated while that signal is
blocked and pending, each occurrence of the signal is left pending.  If
the signal is later unblocked, multiple instances of that signal can be
delivered to the process.

A signal that is both blocked and ignored for a calling process remains
pending if generated.  Calls to the sigpending() function return signals
that are both blocked and ignored.  When the signal is no longer blocked,
it is discarded when delivery is attempted.

Setting SIGCHLD to SIG_IGN has no effect on the operation of the wait()
and waitpid() functions.  A strictly conforming POSIX.1 application must
not set the action associated with SIGCHLD to SIG_IGN.

When using the kill() function, the value -1 is not a valid value for
passing to the pid parameter.  If a -1 is passed in the pid parameter,
kill() returns an error and sets errno to EINVAL.

On MPE/iX, a process's real user ID, effective user ID, and saved
set-user-ID are always identical.  In addition, {SAVED_SET_IDS} is always
defined.

If the sigmask parameter of the sigsuspend() function is set to NULL, the
process is suspended with the current signal mask.  This implementation
is considered an extension to the POSIX.1 standard.  A strictly
conforming POSIX application should pass in the sigmask parameter of the
sigsuspend() function the current signal mask returned by a successful
call to sigprocmask() where set is set to NULL.

POSIX/iX library functions that have parameters that pass or return
pointers can return an error and set errno to EFAULT if a NULL or a bad
address is passed.



MPE/iX 5.0 Documentation