Opentopia Directory Encyclopedia Tools

Sigaction (Unix)

Encyclopedia : S : SI : SIG : Sigaction (Unix)


The int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact) function defined in #include specifies the action which should be taken when a signal is received. The sigaction() function provides an interface for reliable signals in replacement of the unreliable and deprecated signal() function.

Signal handlers installed by the signal() interface will be uninstalled immediately prior to execution of the handler. Permanent handlers must therefore be reinstalled by a call to signal() during the handler's execution, causing unreliability in the event a signal of the same type is received during the handler's execution but before the reinstall. Handlers installed by the sigaction() interface can be installed permanently and a custom set of signals can be blocked during the execution of the handler. These signals will be unblocked immediately following the normal termination of the handler (but not in the event of an abnormal termination such as a C++ exception throw.)

To catch(...) signals translated into C++ exceptions, special compiler switches may be necessary on some platforms such as -fnon-call-exceptions for the gcc compiler.

 


From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.

Search Titles
0123456789
ABCDEFGHIJ
KLMNOPQRST
UVWXYZ?

E-mail this article to:

Personal Message: