.ig Copyright (C) 1993,1994 by the author(s). This software is published in the hope that it will be useful, but WITHOUT ANY WARRANTY for any part of this software to work correctly or as described in the manuals. See the ShapeTools Public License for details. Permission is granted to use, copy, modify, or distribute any part of this software but only under the conditions described in the ShapeTools Public License. A copy of this license is supposed to have been given to you along with ShapeTools in a file named LICENSE. Among other things, this copyright notice and the Public License must be preserved on all copies. Author: Andreas Lampen (Andreas.Lampen@cs.tu-berlin.de) $Header: stsignal.3[4.0] Thu Jun 24 17:43:32 1993 andy@cs.tu-berlin.de frozen $ .. .TH stsignal 3 "Thu Jun 24 17:43:32 1993" "sttk-1.7" "ShapeTools Toolkit Library" .SH NAME stCatchSigs, stInterruptAction, stQuitAction, stTermAction, stCleanup, stExit \- signal handling .SH SYNOPSIS #include .br #include .sp .ta 1.3c void stCatchSigs (void); .sp Sfunc_t (*stInterruptAction)(); .sp Sfunc_t (*stQuitAction)(); .sp Sfunc_t (*stTermAction)(); .sp void stCleanup (void); .sp void stExit (int exitCode); .sp .SH DESCRIPTION \fIstCatchSigs\fP activates a number of interrupt handlers, defined internally in the ShapeTools toolkit library. Interrupt handlers are defined for the signals SIGINT, SIGQUIT, SIGFPE, SIGBUS, SIGSEGV, and SIGTERM. All interrupt handlers, except the one for SIGINT, cause program termination after having done some cleanup work. The cleanup consists of removing all temporary files by calling stRmRegisteredFiles(3). .LP Some of the signal handlers are capable to execute functions defined by the application, while handling the interrupt. This mechanism is activated by assigning a functions address to the appropriate variable. The following is a complete List. .TP 2c Signal Variable .TP SIGINT \fIstInterruptAction\fP .TP SIGQUIT \fIstQuitAction\fP .TP SIGTERM \fIstTermAction\fP .LP \fIstCleanup\fP calls stRmRegisteredFiles(3) to remove all temporary files and the AtFS function af_cleanup(3) that orders AtFS's affairs. .LP \fIstExit\fP does the same as stCleanup and additionally end the program execution returning \fIexitCode\fP. .SH SEE ALSO signal (3), stRmRegisteredFiles(3), af_cleanup(3).