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/signalsuspend.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/signalsuspend.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/signalsuspend.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/signalsuspend.html on line 8

SignalSuspend(), SignalSuspend_r()

Suspend a thread until a signal is received

Synopsis:

#include <sys/neutrino.h>

int SignalSuspend( const sigset_t* set );

int SignalSuspend_r( const sigset_t* set );

Arguments:

set
A pointer to a sigset_t object that specifies the signals you want to wait for.

Library:

libc

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

Description:

These kernel calls replace the thread's signal mask with the set of signals pointed to by set and then suspends the thread until delivery of a signal whose action is either to execute a signal-catching function (then return), or to terminate the thread. On return, the previous signal mask is restored.

The SignalSuspend() and SignalSuspend_r() functions are identical, except in the way they indicate errors. See the Returns section for details.


Note: Instead of using these kernel calls directly, consider calling sigsuspend().

Attempts to block SIGKILL or SIGSTOP are ignored. This is done without causing an error.

If you're using SignalSuspend() to synchronously wait for a signal, consider using the more efficient POSIX 1003.1b realtime sigwaitinfo() call.

Blocking states

STATE_SIGSUSPEND
The calling thread blocks waiting for a signal.

Returns:

The only difference between these functions is the way they indicate errors.

Since SignalSuspend() and SignalSuspend_r() block until interrupted, there's no successful return value.

SignalSuspend()
-1 is always returned and errno is set.
SignalSuspend_r()
errno is NOT set, a value in the Errors section is returned.

If the signal handler calls longjmp() or siglongjmp(), SignalSuspend() and SignalSuspend_r() don't return.

Errors:

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

Classification:

QNX Neutrino

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

See also:

SignalKill(), sigsuspend()


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/signalsuspend.html on line 188

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/signalsuspend.html on line 188