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 1994 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #pragma ident "%Z%%M% %I% %E% SMI"
30 * posix signal package
36 #define cantmask (sigmask(SIGKILL)|sigmask(SIGSTOP))
40 * sigemptyset - all known signals
43 sigemptyset(sigset_t
*sigp
)
54 * sigfillset - all known signals
57 sigfillset(sigset_t
*sigp
)
63 *sigp
= sigmask(NSIG
- 1) | (sigmask(NSIG
- 1) - 1);
68 * add the signal to the set
71 sigaddset(sigset_t
*sigp
, int signo
)
73 if (!sigp
|| signo
<= 0 || signo
>= NSIG
) {
77 *sigp
|= sigmask(signo
);
82 * remove the signal from the set
85 sigdelset(sigset_t
*sigp
, int signo
)
87 if (!sigp
|| signo
<= 0 || signo
>= NSIG
) {
91 *sigp
&= ~sigmask(signo
);
96 * return true if the signal is in the set (return is 0 or 1)
99 sigismember(sigset_t
*sigp
, int signo
)
101 if (!sigp
|| signo
<= 0 || signo
>= NSIG
) {
105 return ((*sigp
& sigmask(signo
)) != 0);