sigwaitinfo(), sigtimedwait()

queue a signal to a process 

Function


SYNOPSIS

#include <signal.h>

int sigwaitinfo(const sigset_t *set, siginfo_t *info);

int sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *timeout);


DESCRIPTION

The sigwaitinfo() function selects a pending signal from set, atomically clears it from the system's set of pending signals, and returns that signal number. If no signal in set is pending at the time of the call, the thread is suspended until one or more becomes pending. The signals defined by set are blocked at the time of the call to sigwaitinfo().

The sigtimedwait() function behaves the same as the sigwaitinfo() function except that if none of the signals specified in set are pending, sigtimedwait() returns an error if a signal in set does not arrive in the time interval specified time timeout.

Should any of multiple pending signals in the range SIGRTMIN to SIGRTMAX be selected, it will be the lowest numbered one. The selection order between realtime and non-realtime signals, and the selection order between non-realtime signals is unspecified.

Should the info argument be a NULL pointer, the sigwaitinfo() function behaves the same as the sigwait() function.

If more than one thread is using sigwaitinfo() to wait for the same signal, no more than one of these threads returns from sigwaitinfo() with the signal number.


PARAMETERS

info 

Returns information about the selected signal.

set 

Specifies the set of signals to wait for.

timeout 

Specifies the maximum time to wait for a selected signal to arrive.


RETURN VALUES

On success, sigwaitinfo() and sigtimedwait() return a value of zero. On failure, they return -1 and set errno to one of the following values:

EAGAIN 

No signal specified by set arrived within the specified timeout period.

EFAULT 

sig or set is an invalid pointer.

EINVAL 

The set argument contains an invalid or unsupported signal number.

EINVAL 

The timeout value specified has a tv_nsec value that is either less than 0 or over 109.


CONFORMANCE

POSIX Realtime Extensions.


MULTITHREAD SAFETY LEVEL

MT-safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

api_intro

Functions:
pause(), sigaction(), signal(), sigpending(), sigwait()


PTC MKS Toolkit 10.4 Documentation Build 39.