Utah Raster Toolkit  9999-git
URT Development version (post-3.1b)
sig.c
Go to the documentation of this file.
1 /*
2  * This software is copyrighted as noted below. It may be freely copied,
3  * modified, and redistributed, provided that the copyright notice is
4  * preserved on all copies.
5  *
6  * There is no warranty or other guarantee of fitness for this software,
7  * it is provided solely "as is". Bug reports or fixes may be sent
8  * to the author, who may or may not act on them as he desires.
9  *
10  * You may not include this software in a program or other software product
11  * without supplying the source, or without informing the end-user that the
12  * source is available for no extra charge.
13  *
14  * If you modify this software, you should include a notice giving the
15  * name of the person performing the modification, the date of modification,
16  * and the reason for such modification.
17  */
18 /* sig.c, 7/2/86, T. McCollough, UU */
19 
20 #include <signal.h>
21 
22 int sig_handler ( sig, code, scp )
23 int sig, code;
24 struct sigcontext *scp;
25 {
26  psignal( sig, "getcx3d" );
27  done( );
28 }
29 
30 sig_setup ( ) {
31  static struct sigvec vec = { sig_handler, 0xffffffff, 0 };
32 
33  sigvec( SIGHUP, & vec, 0 );
34  sigvec( SIGINT, & vec, 0 );
35  sigvec( SIGQUIT, & vec, 0 );
36  sigvec( SIGILL, & vec, 0 );
37  sigvec( SIGTRAP, & vec, 0 );
38  sigvec( SIGIOT, & vec, 0 );
39  sigvec( SIGEMT, & vec, 0 );
40  sigvec( SIGFPE, & vec, 0 );
41  /*sigvec( SIGBUS, & vec, 0 );*/
42  sigvec( SIGSEGV, & vec, 0 );
43  sigvec( SIGSYS, & vec, 0 );
44  sigvec( SIGPIPE, & vec, 0 );
45  sigvec( SIGALRM, & vec, 0 );
46  sigvec( SIGTERM, & vec, 0 );
47  sigvec( SIGURG, & vec, 0 );
48  sigvec( SIGCHLD, & vec, 0 );
49  sigvec( SIGTTIN, & vec, 0 );
50  sigvec( SIGTTOU, & vec, 0 );
51  sigvec( SIGIO, & vec, 0 );
52  sigvec( SIGXCPU, & vec, 0 );
53  sigvec( SIGXFSZ, & vec, 0 );
54  sigvec( SIGVTALRM, & vec, 0 );
55  sigvec( SIGPROF, & vec, 0 );
56  sigvec( SIGWINCH, & vec, 0 );
57 }
58 
59 sig_unblock ( ) {
60  sigsetmask( 0 );
61 }
62 
63 sig_block ( ) {
64  sigsetmask( 0xffffffff );
65 }