@@ -44,49 +44,39 @@ pub const SIGEMT: libc::c_int = 7;
44
44
45
45
pub const NSIG : libc:: c_int = 32 ;
46
46
47
- pub use self :: signal:: {
48
- SockFlag ,
49
-
50
- SA_NOCLDSTOP ,
51
- SA_NOCLDWAIT ,
52
- SA_NODEFER ,
53
- SA_ONSTACK ,
54
- SA_RESETHAND ,
55
- SA_RESTART ,
56
- SA_SIGINFO ,
57
- } ;
58
-
59
- pub use self :: signal:: { HowFlag , SIG_BLOCK , SIG_UNBLOCK , SIG_SETMASK } ;
60
47
pub use self :: signal:: sigset_t;
61
48
49
+
50
+ bitflags ! {
51
+ flags SockFlag : libc:: c_int {
52
+ const SA_NOCLDSTOP = libc:: SA_NOCLDSTOP ,
53
+ const SA_NOCLDWAIT = libc:: SA_NOCLDWAIT ,
54
+ const SA_NODEFER = libc:: SA_NODEFER ,
55
+ const SA_ONSTACK = libc:: SA_ONSTACK ,
56
+ const SA_RESETHAND = libc:: SA_RESETHAND ,
57
+ const SA_RESTART = libc:: SA_RESTART ,
58
+ const SA_SIGINFO = libc:: SA_SIGINFO ,
59
+ }
60
+ }
61
+
62
+ bitflags ! {
63
+ flags HowFlag : libc:: c_int {
64
+ const SIG_BLOCK = libc:: SIG_BLOCK ,
65
+ const SIG_UNBLOCK = libc:: SIG_UNBLOCK ,
66
+ const SIG_SETMASK = libc:: SIG_SETMASK ,
67
+ }
68
+ }
69
+
62
70
#[ cfg( any( all( target_os = "linux" ,
63
71
any( target_arch = "x86" ,
64
72
target_arch = "x86_64" ,
65
73
target_arch = "aarch64" ,
66
74
target_arch = "arm" ) ) ,
67
75
target_os = "android" ) ) ]
68
76
pub mod signal {
69
- use libc;
70
77
71
- bitflags ! (
72
- flags SockFlag : libc:: c_ulong {
73
- const SA_NOCLDSTOP = 0x00000001 ,
74
- const SA_NOCLDWAIT = 0x00000002 ,
75
- const SA_NODEFER = 0x40000000 ,
76
- const SA_ONSTACK = 0x08000000 ,
77
- const SA_RESETHAND = 0x80000000 ,
78
- const SA_RESTART = 0x10000000 ,
79
- const SA_SIGINFO = 0x00000004 ,
80
- }
81
- ) ;
82
-
83
- bitflags ! {
84
- flags HowFlag : libc:: c_int {
85
- const SIG_BLOCK = 0 ,
86
- const SIG_UNBLOCK = 1 ,
87
- const SIG_SETMASK = 2 ,
88
- }
89
- }
78
+ use libc;
79
+ use super :: SockFlag ;
90
80
91
81
// This definition is not as accurate as it could be, {pid, uid, status} is
92
82
// actually a giant union. Currently we're only interested in these fields,
@@ -130,26 +120,7 @@ pub mod signal {
130
120
any( target_arch = "mips" , target_arch = "mipsel" ) ) ) ]
131
121
pub mod signal {
132
122
use libc;
133
-
134
- bitflags ! (
135
- flags SockFlag : libc:: c_uint {
136
- const SA_NOCLDSTOP = 0x00000001 ,
137
- const SA_NOCLDWAIT = 0x00001000 ,
138
- const SA_NODEFER = 0x40000000 ,
139
- const SA_ONSTACK = 0x08000000 ,
140
- const SA_RESETHAND = 0x80000000 ,
141
- const SA_RESTART = 0x10000000 ,
142
- const SA_SIGINFO = 0x00000008 ,
143
- }
144
- ) ;
145
-
146
- bitflags ! {
147
- flags HowFlag : libc:: c_int {
148
- const SIG_BLOCK = 1 ,
149
- const SIG_UNBLOCK = 2 ,
150
- const SIG_SETMASK = 3 ,
151
- }
152
- }
123
+ use super :: SockFlag ;
153
124
154
125
// This definition is not as accurate as it could be, {pid, uid, status} is
155
126
// actually a giant union. Currently we're only interested in these fields,
@@ -187,26 +158,7 @@ pub mod signal {
187
158
target_os = "netbsd" ) ) ]
188
159
pub mod signal {
189
160
use libc;
190
-
191
- bitflags ! (
192
- flags SockFlag : libc:: c_int {
193
- const SA_NOCLDSTOP = 0x0008 ,
194
- const SA_NOCLDWAIT = 0x0020 ,
195
- const SA_NODEFER = 0x0010 ,
196
- const SA_ONSTACK = 0x0001 ,
197
- const SA_RESETHAND = 0x0004 ,
198
- const SA_RESTART = 0x0002 ,
199
- const SA_SIGINFO = 0x0040 ,
200
- }
201
- ) ;
202
-
203
- bitflags ! {
204
- flags HowFlag : libc:: c_int {
205
- const SIG_BLOCK = 1 ,
206
- const SIG_UNBLOCK = 2 ,
207
- const SIG_SETMASK = 3 ,
208
- }
209
- }
161
+ use super :: SockFlag ;
210
162
211
163
#[ cfg( any( target_os = "macos" , target_os = "ios" , target_os = "openbsd" ) ) ]
212
164
pub type sigset_t = u32 ;
@@ -391,6 +343,7 @@ impl AsRef<sigset_t> for SigSet {
391
343
392
344
pub use self :: signal:: siginfo;
393
345
346
+ #[ allow( unknown_lints) ]
394
347
#[ allow( raw_pointer_derive) ]
395
348
#[ derive( Clone , Copy ) ]
396
349
pub enum SigHandler {
@@ -518,7 +471,7 @@ mod tests {
518
471
let mask2 = SigSet :: empty ( ) ;
519
472
mask. add ( SIGUSR2 ) . unwrap ( ) ;
520
473
521
- let oldmask = mask2. thread_swap_mask ( signal :: SIG_SETMASK ) . unwrap ( ) ;
474
+ let oldmask = mask2. thread_swap_mask ( SIG_SETMASK ) . unwrap ( ) ;
522
475
523
476
assert ! ( oldmask. contains( SIGUSR1 ) . unwrap( ) ) ;
524
477
assert ! ( !oldmask. contains( SIGUSR2 ) . unwrap( ) ) ;
0 commit comments