HPlogo MPE/iX Developer's Kit Reference Manual Volume I: HP 3000 MPE/iX Computer Systems > Chapter 3  MPE/iX Library Implementation Considerations

Signals

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

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-6 “POSIX/iX Signals” 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-6 POSIX/iX Signals

Constant

Default

Action

Description and Implementation Details

SIGABRTAbnormal termination

Abnormal termination signal (initiated by the abort() function).

Required for POSIX.1 conformance.

SIGALRMAbnormal termination

Timeout signal (initiated by the alarm() function).

Required for POSIX.1 conformance.

SIGBUSAbnormal terminationAddress violation. SIGBUS is not required for POSIX.1 conformance, but is a signal commonly used on UNIX™-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.
SIGFPEAbnormal termination

Erroneous arithmetic operation, such as division by zero or 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.

SIGHUPAbnormal termination

Hang-up detected on a controlling terminal or death of a controlling process.

Required for POSIX.1 conformance.

SIGILLAbnormal termination

Detection of an invalid or illegal hardware instruction (not reset when caught).

Required for POSIX.1 conformance.

SIGINTAbnormal termination

Interactive interrupt signal.

Required for POSIX.1 conformance.

SIGKILLAbnormal termination

Termination signal (cannot be caught or ignored). If an application attempts to change the default action associated with SIGKILL, the attempt is ignored without error.

Required for POSIX.1 conformance.

SIGPIPEAbnormal termination

Write on a pipe with no readers.

Required for POSIX.1 conformance.

SIGPOLLIgnoreStreams poll signal. Also known as SIGIO.
SIGQUITAbnormal termination

Interactive termination signal.

Required for POSIX.1 conformance.

SIGSEGVAbnormal termination

Detection of an invalid or illegal memory reference. 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.

SIGTERMAbnormal termination

Software termination signal (initiated by the kill() function).

Required for POSIX.1 conformance.

SIGURGIgnoreUrgent condition in I/O channel.
SIGUSR1Abnormal termination

Reserved as application-defined signal #1.

Required for POSIX.1 conformance.

SIGUSR2Abnormal termination

Reserved as application-defined signal #2.

Required for POSIX.1 conformance.

Job Control Signals
SIGCHLDIgnore the signal

Child process stopped or terminated.

Required for POSIX.1 conformance.

SIGCONTContinue if stopped; otherwise, ignore

Continue if stopped. This signal is never generated by the system.

Required for POSIX.1 conformance.

SIGSTOPStop the process

Stop signal (cannot be caught or ignored). If an 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.

SIGTSTPStop the process

Interactive stop signal. 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.

SIGTTINStop the process

Read from the controlling terminal attempted by a member of 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.

SIGTTOUStop the process

Write to the controlling terminal attempted by a member of 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.

 

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.

Feedback to webmaster