Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/sigwait.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/sigwait.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/sigwait.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/sigwait.html on line 8

sigwait()

Wait for a pending signal

Synopsis:

#include <signal.h>

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

Arguments:

set
A pointer to a sigset_t object that specifies the signals you want to wait for.
sig
A pointer to a location where the function can store the signal that it cleared.

Library:

libc

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

Description:

The sigwait() function selects a pending signal from set, atomically clears it from the set of pending signals in the system, and returns that signal number in sig. If there are multiple signals queued for the signal number selected, the first signal causes a return from sigwait() and the rest remain queued. 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 must be blocked before you call sigwait(); otherwise, the behavior is undefined. The effect of sigwait() on the signal actions for the signals in set is unspecified.

If more than one thread is using sigwait() to wait for the same signal, only one of the threads returns from sigwait() with the signal number — which one is unspecified.

Returns:

0
Success (that is, one of the signals specified by set is pending or has been generated).
EINTR
The sigwait() function was interrupted by a signal.
EINVAL
The set argument contains an invalid or unsupported signal number.
EFAULT
A fault occurred while accessing the provided buffers.

Classification:

POSIX 1003.1

Safety:
Cancellation point Yes
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

pause(), pthread_sigmask(), sigaction(), sigpending(), sigsuspend()

Clocks, Timers, and Getting a Kick Every So Often chapter of Getting Started with QNX Neutrino


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/sigwait.html on line 161

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/sigwait.html on line 161