#include <signal.h> int Qp0sDisableSignals( void );
The Qp0sDisableSignals() function prevents the process from receiving signals.
After Qp0sDisableSignals() is called, the process is no longer eligible to receive signals from another process or the system. Calls to functions that examine the signal action or the signal blocking mask of the thread will not return the requested information. For details on those functions, see sigaction()--Examine and Change Signal Action and sigprocmask()--Examine and Change Blocked Signals.
If the process is currently disabled for signals, a call to Qp0sDisableSignals() has no effect and an [ENOTSIGINIT] error is returned.
None.
None
0 | Qp0sDisableSignals() was successful. |
-1 | Qp0sDisableSignals() was not successful. The errno variable is set to indicate the error. |
If Qp0sDisableSignals() is not successful, errno usually indicates the following error. Under some conditions, errno could indicate an error other than that listed here.
Process not enabled for signals.
An attempt was made to call a signal function under one of the following conditions:
Use of the following functions enables a process for signals:
Any of the Pthread APIs. See Pthread APIs for more information.
See Code disclaimer information for information pertaining to code examples.
The following example shows how a process can reset its signal vector and signal blocking mask.
#include <signal.h> #include <time.h> #include <unistd.h> #include <stdio.h> void timestamp( char *str ) { time_t t; time( &t ); printf( "%s the time is %s\n", str, ctime(&t) ); } int main( int argc, char * argv[] ) { unsigned int ret; timestamp( "before sleep()" ); /* * The sleep() function implicitly enables the process to * receive signals. */ ret = sleep( 10 ); timestamp( "after sleep()" ); printf( "sleep() returned %d\n", ret ); /* * Qp0sDisableSignals() prevents the process from receiving * signals. If the call to the Qp0sDisableSignals() function * is not done, the process would remain eligible to receive * signals after the return from main(). */ Qp0sDisableSignals(); return( 0 ); }
before sleep() the time is Sun Jan 22 17:25:17 1995 after sleep() the time is Sun Jan 22 17:25:28 1995 sleep() returned 0
Top | UNIX-Type APIs | APIs by category |