SignalWaitinfoMask(), SignalWaitinfoMask_r()

QNX SDP8.0C Library ReferenceAPIDeveloper

Block a set of signals and then select a pending signal

Synopsis:

#include <sys/neutrino.h>

int SignalWaitinfoMask( const sigset_t* set,
                        siginfo_t* info,
                        const sigset_t *mask );

int SignalWaitinfoMask_r( const sigset_t* set,
                          siginfo_t* info,
                          const sigset_t *mask );

Arguments:

set
A pointer to a sigset_t object that specifies the signals you want to wait for.
info
NULL, or a pointer to a siginfo_t structure where the function can store information about the signal.
mask
NULL, or a pointer to a sigset_t object that specifies a new signal mask.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The SignalWaitinfoMask() and SignalWaitinfoMask_r() kernel calls replace the thread's signal mask with the one specified by mask and then select the pending signal from the set specified by set. If no signal in set is pending at the time of the call, the thread blocks until one or more signals in set become pending or until the thread block is interrupted by an unblocked, caught signal. These functions restore the calling thread's original signal mask before returning.

These functions are identical except in the way they indicate errors. See the Returns section for details.

These kernel calls are similar to SignalWaitinfo() and SignalWaitinfo_r() but avoid the race condition between blocking signals, potentially getting a signal, and then blocking while waiting for that signal.

If the info argument isn't NULL, information on the selected signal is stored there as follows:

siginfo_t member Description
si_signo Selected signal number
si_code Signal code
si_value Signal value

If, while SignalWaitinfoMask() is waiting, a caught signal occurs that isn't blocked, the signal handler is invoked and SignalWaitinfoMask() is interrupted with an error of EINTR.

Blocking states

STATE_SIGWAITINFO
The calling thread blocks waiting for a signal.

Returns:

A signal number. If an error occurs:

  • SignalWaitinfoMask() returns -1 and sets errno.
  • SignalWaitinfoMask_r() returns the negative of a value from the Errors section and doesn't set errno.

Errors:

EINTR
The call was interrupted by a signal.
EFAULT
A fault occurred when the kernel tried to access the buffers provided.
ETIMEDOUT
A kernel timeout unblocked the call. See TimerTimeout().

Classification:

QNX OS

Safety:
Cancellation pointYes
Signal handlerYes
ThreadYes
Page updated: