HPlogo MPE/iX Developer's Kit Reference Manual Volume I: HP 3000 MPE/iX Computer Systems > Chapter 4  POSIX/iX Library Function Descriptions

sigsuspend

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

Replaces the calling process's signal mask and suspends the calling process to wait for a signal.

Syntax

   #include <signal.h>

   int sigsuspend (sigset_t *sigmask);

Parameters

sigmask

If not NULL, a pointer to a structure of type sigset_t that contains a new signal mask to be installed before suspending the calling process. If NULL, the process's current signal mask is used.

Return Values

No return

Because sigsuspend() suspends process execution indefinitely, there is no return value indicating success.

-1

An error occurred, and errno is set to indicate the error condition.

Description

The sigsuspend() function replaces the calling process's signal mask with the set of signals pointed to by sigmask. It then suspends the process until the delivery of a signal whose action is either to execute a signal-handling function (signal handler) or to terminate the process.

If the action is to execute a signal handler, upon completion of the signal handler, sigsuspend() returns and restores the process's previous signal mask. If the signal action is to terminate the process, sigsuspend() does not return.

It is not possible to block the signals SIGKILL and SIGSTOP. If specified in the structure pointed to by sigmask, they are removed by the system without error.

Implementation Considerations

Refer to the EFAULT error description below.

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.

Errors

If an error occurs, errno is set to one of the following values:

EFAULTCAUSEThe system detected a bad address in attempting to use the sigmask parameter.
 ACTIONMake sure that the pointer is correctly initialized.
EINTRCAUSEA signal was caught by the process, and control was returned from a signal-handling function.
 ACTIONNo action required.

See Also

pause(), sigaction(), sigpending(), sigprocmask(), <signal.h>, POSIX.1 (Section 3.3.7)

Feedback to webmaster