File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed
branches/try/src/libstd/sys/unix Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: aca2057ed5fb7af3f8905b2bc01f72fa001c35c8
3
3
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4
- refs/heads/try: cae005162d1d7aea6cffdc299fedf0d2bb2a4b28
4
+ refs/heads/try: a8dbb92b471cae1d3f8225857f5553311dd8aeb3
5
5
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
6
6
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
7
7
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Original file line number Diff line number Diff line change @@ -135,7 +135,9 @@ extern {
135
135
pub fn sigaltstack ( ss : * const sigaltstack ,
136
136
oss : * mut sigaltstack ) -> libc:: c_int ;
137
137
138
+ #[ cfg( not( target_os = "android" ) ) ]
138
139
pub fn sigemptyset ( set : * mut sigset_t ) -> libc:: c_int ;
140
+
139
141
pub fn pthread_sigmask ( how : libc:: c_int , set : * const sigset_t ,
140
142
oldset : * mut sigset_t ) -> libc:: c_int ;
141
143
@@ -155,6 +157,14 @@ extern {
155
157
-> * mut libc:: c_char ;
156
158
}
157
159
160
+ // Ugh. This is only available as an inline until Android API 21.
161
+ #[ cfg( target_os = "android" ) ]
162
+ pub unsafe fn sigemptyset ( set : * mut sigset_t ) -> libc:: c_int {
163
+ use intrinsics;
164
+ intrinsics:: write_bytes ( set, 0 , 1 ) ;
165
+ return 0 ;
166
+ }
167
+
158
168
#[ cfg( any( target_os = "linux" ,
159
169
target_os = "android" ) ) ]
160
170
mod signal_os {
Original file line number Diff line number Diff line change @@ -446,12 +446,22 @@ mod tests {
446
446
use mem;
447
447
use ptr;
448
448
use libc;
449
+ use slice;
449
450
use sys:: { self , c, cvt, pipe} ;
450
451
452
+ #[ cfg( not( target_os = "android" ) ) ]
451
453
extern {
452
454
fn sigaddset ( set : * mut c:: sigset_t , signum : libc:: c_int ) -> libc:: c_int ;
453
455
}
454
456
457
+ #[ cfg( target_os = "android" ) ]
458
+ unsafe fn sigaddset ( set : * mut c:: sigset_t , signum : libc:: c_int ) -> libc:: c_int {
459
+ let raw = slice:: from_raw_parts_mut ( set as * mut u8 , mem:: size_of :: < c:: sigset_t > ( ) ) ;
460
+ let bit = ( signum - 1 ) as usize ;
461
+ raw[ bit / 8 ] |= 1 << ( bit % 8 ) ;
462
+ return 0 ;
463
+ }
464
+
455
465
#[ test]
456
466
fn test_process_mask ( ) {
457
467
unsafe {
You can’t perform that action at this time.
0 commit comments