Print this page
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/common/brand/lx/lx_signum.h
+++ new/usr/src/common/brand/lx/lx_signum.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 * Copyright 2015 Joyent, Inc.
25 25 */
26 26
27 27 #ifndef _LX_SIGNUM_H
28 28 #define _LX_SIGNUM_H
29 29
30 30 #ifdef __cplusplus
31 31 extern "C" {
32 32 #endif
33 33
34 34 #define LX_SIGHUP 1
35 35 #define LX_SIGINT 2
36 36 #define LX_SIGQUIT 3
37 37 #define LX_SIGILL 4
38 38 #define LX_SIGTRAP 5
39 39 #define LX_SIGABRT 6
40 40 #define LX_SIGIOT 6
41 41 #define LX_SIGBUS 7
42 42 #define LX_SIGFPE 8
43 43 #define LX_SIGKILL 9
44 44 #define LX_SIGUSR1 10
45 45 #define LX_SIGSEGV 11
46 46 #define LX_SIGUSR2 12
47 47 #define LX_SIGPIPE 13
48 48 #define LX_SIGALRM 14
49 49 #define LX_SIGTERM 15
50 50 #define LX_SIGSTKFLT 16
51 51 #define LX_SIGCHLD 17
52 52 #define LX_SIGCONT 18
53 53 #define LX_SIGSTOP 19
54 54 #define LX_SIGTSTP 20
55 55 #define LX_SIGTTIN 21
56 56 #define LX_SIGTTOU 22
57 57 #define LX_SIGURG 23
58 58 #define LX_SIGXCPU 24
59 59 #define LX_SIGXFSZ 25
60 60 #define LX_SIGVTALRM 26
61 61 #define LX_SIGPROF 27
62 62 #define LX_SIGWINCH 28
63 63 #define LX_SIGIO 29
64 64 #define LX_SIGPOLL LX_SIGIO
65 65 #define LX_SIGPWR 30
66 66 #define LX_SIGSYS 31
67 67 #define LX_SIGUNUSED 31
68 68
69 69 #define LX_NSIG 64 /* Linux _NSIG */
70 70
71 71 #define LX_SIGRTMIN 32
72 72 #define LX_SIGRTMAX LX_NSIG
73 73
74 74 extern const int ltos_signo[];
75 75 extern const int stol_signo[];
76 76
77 77 extern int lx_stol_signo(int, int);
78 78 extern int lx_ltos_signo(int, int);
79 79 extern int lx_stol_status(int, int);
80 80 extern int lx_stol_sigcode(int);
81 81
82 82 /*
83 83 * NOTE: Linux uses different definitions for 'sigset_t's and 'sigaction_t's
84 84 * depending on whether the definition is for user space or the kernel.
85 85 *
86 86 * The definitions below MUST correspond to the Linux kernel versions,
87 87 * as glibc will do the necessary translation from the Linux user
88 88 * versions.
89 89 */
90 90 #if defined(_LP64)
91 91 #define LX_NSIG_WORDS 1
92 92 #define LX_WSHIFT 6
93 93 #elif defined(_ILP32)
94 94 #define LX_NSIG_WORDS 2
95 95 #define LX_WSHIFT 5
96 96 #else
97 97 #error "LX only supports LP64 and ILP32"
98 98 #endif
99 99
100 100 typedef struct {
101 101 ulong_t __bits[LX_NSIG_WORDS];
102 102 } lx_sigset_t;
103 103
104 104 #define LX_NBITS (sizeof (ulong_t) * NBBY)
105 105 #define lx_sigmask(n) (1UL << (((n) - 1) % LX_NBITS))
106 106 #define lx_sigword(n) (((ulong_t)((n) - 1)) >> LX_WSHIFT)
107 107 #define lx_sigismember(s, n) (lx_sigmask(n) & (s)->__bits[lx_sigword(n)])
108 108 #define lx_sigaddset(s, n) ((s)->__bits[lx_sigword(n)] |= lx_sigmask(n))
109 109
110 110 #ifdef __cplusplus
111 111 }
112 112 #endif
113 113
114 114 #endif /* _LX_SIGNUM_H */
|
↓ open down ↓ |
114 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX