4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
26 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
27 /* All Rights Reserved */
30 #pragma ident "%Z%%M% %I% %E% SMI"
38 * ttymon catch some signals and ignore the rest.
40 * SIGTERM - killed by somebody
41 * SIGPOLL - got message on pmpipe, probably from sac
43 * SIGCLD - tmchild died
49 struct sigaction sigact
;
50 extern void sigterm();
51 extern void sigchild();
52 extern void sigpoll_catch();
54 extern void dump_pmtab();
55 extern void dump_ttydefs();
57 debug("in catch_signals");
61 (void)sigdelset(&cset
, SIGTERM
);
62 (void)sigdelset(&cset
, SIGCLD
);
63 (void)sigdelset(&cset
, SIGPOLL
);
65 (void)sigdelset(&cset
, SIGUSR1
);
66 (void)sigdelset(&cset
, SIGUSR2
);
68 (void)sigprocmask(SIG_SETMASK
, &cset
, NULL
);
70 sigact
.sa_handler
= sigterm
;
71 (void)sigemptyset(&sigact
.sa_mask
);
72 (void)sigaddset(&sigact
.sa_mask
, SIGTERM
);
73 (void)sigaction(SIGTERM
, &sigact
, NULL
);
75 sigact
.sa_handler
= sigchild
;
76 (void)sigemptyset(&sigact
.sa_mask
);
77 (void)sigaction(SIGCLD
, &sigact
, NULL
);
79 sigact
.sa_handler
= sigpoll_catch
;
80 (void)sigemptyset(&sigact
.sa_mask
);
81 (void)sigaddset(&sigact
.sa_mask
, SIGPOLL
);
82 (void)sigaction(SIGPOLL
, &sigact
, NULL
);
85 sigact
.sa_handler
= dump_pmtab
;
86 (void)sigemptyset(&sigact
.sa_mask
);
87 (void)sigaddset(&sigact
.sa_mask
, SIGUSR1
);
88 (void)sigaction(SIGUSR1
, &sigact
, NULL
);
90 sigact
.sa_handler
= dump_ttydefs
;
91 (void)sigemptyset(&sigact
.sa_mask
);
92 (void)sigaddset(&sigact
.sa_mask
, SIGUSR2
);
93 (void)sigaction(SIGUSR2
, &sigact
, NULL
);
98 * child_sigcatch() - tmchild inherits some signal_catch from parent
99 * and need to reset them
104 struct sigaction sigact
;
106 extern void sigpoll();
107 extern void sigint();
110 (void)sigdelset(&cset
, SIGINT
);
111 (void)sigdelset(&cset
, SIGPOLL
);
112 (void)sigprocmask(SIG_SETMASK
, &cset
, NULL
);
114 sigact
.sa_handler
= sigpoll
;
115 (void)sigemptyset(&sigact
.sa_mask
);
116 (void)sigaddset(&sigact
.sa_mask
, SIGPOLL
);
117 (void)sigaction(SIGPOLL
, &sigact
, NULL
);
119 sigact
.sa_handler
= sigint
;
120 (void)sigemptyset(&sigact
.sa_mask
);
121 (void)sigaddset(&sigact
.sa_mask
, SIGINT
);
122 (void)sigaction(SIGINT
, &sigact
, NULL
);