[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions , Volume 2


sigwait Subroutine

Purpose

Blocks the calling thread until a specified signal is received.

Library

Threads Library (libpthreads.a)

Syntax

#include </usr/include/dce/cma_sigwait.h>


int sigwait ( set, sig)
const sigset_t *set;
int *sig;

Description

The sigwait subroutine blocks the calling thread until one of the signal in the signal set set is received by the thread. Only asynchronous signals can be waited for.

The signal can be either sent directly to the thread, using the pthread_kill subroutine, or to the process. In that case, the signal will be delivered to exactly one thread that has not blocked the signal.

Concurrent use of sigaction and sigwait subroutines on the same signal is forbidden.

Parameters


set Specifies the set of signals to wait on.
sig Points to where the received signal number will be stored.

Return Values

Upon successful completion, the received signal number is returned via the sig parameter, and 0 is returned. Otherwise, an error code is returned.

Error Code

The sigwait subroutine is unsuccessful if the following is true:

EINVAL The set parameter contains an invalid or unsupported signal number.

Implementation Specifics

These subroutines are part of Base Operating System (BOS) Runtime.

Related Information

The kill subroutine, pthread_kill subroutine, sigaction (sigaction, sigvec, or signal Subroutine) subroutine, sigthreadmask (sigthreadmask Subroutine) subroutine.

Signal Management in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs .


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]