@@ -5,7 +5,14 @@ extern crate libc;
5
5
use libc:: { c_uchar, c_uint, c_void, cmsghdr, msghdr} ;
6
6
use std:: { mem, ptr} ;
7
7
8
- #[ cfg( unix) ]
8
+ // Run these tests on all Unixen, but skip them on platforms that fail due to
9
+ // suspected QEMU bugs. Sparc64 gets SIGILL and s390x hangs, both before
10
+ // executing any test functions.
11
+ #[ cfg( all( unix,
12
+ not( target_arch = "sparc64" ) ,
13
+ not( target_arch = "s390x" ) ) ) ]
14
+ {
15
+
9
16
extern {
10
17
pub fn cmsg_firsthdr ( msgh : * const msghdr ) -> * mut cmsghdr ;
11
18
pub fn cmsg_nxthdr ( mhdr : * const msghdr ,
@@ -15,7 +22,6 @@ extern {
15
22
pub fn cmsg_data ( cmsg : * const cmsghdr ) -> * mut c_uchar ;
16
23
}
17
24
18
- #[ cfg( unix) ]
19
25
#[ test]
20
26
fn test_cmsg_data ( ) {
21
27
for l in 0 ..128 {
@@ -26,7 +32,6 @@ fn test_cmsg_data() {
26
32
}
27
33
}
28
34
29
- #[ cfg( unix) ]
30
35
#[ test]
31
36
fn test_cmsg_firsthdr ( ) {
32
37
let mut mhdr: msghdr = unsafe { mem:: zeroed ( ) } ;
@@ -40,7 +45,6 @@ fn test_cmsg_firsthdr() {
40
45
}
41
46
}
42
47
43
- #[ cfg( unix) ]
44
48
#[ test]
45
49
fn test_cmsg_len ( ) {
46
50
for l in 0 ..128 {
@@ -50,7 +54,6 @@ fn test_cmsg_len() {
50
54
}
51
55
}
52
56
53
- #[ cfg( unix) ]
54
57
#[ test]
55
58
fn test_cmsg_nxthdr ( ) {
56
59
let mut buffer = [ 0u8 ; 256 ] ;
@@ -83,7 +86,6 @@ fn test_cmsg_nxthdr() {
83
86
}
84
87
}
85
88
86
- #[ cfg( unix) ]
87
89
#[ test]
88
90
fn test_cmsg_space ( ) {
89
91
unsafe {
@@ -92,3 +94,5 @@ fn test_cmsg_space() {
92
94
}
93
95
}
94
96
}
97
+
98
+ }
0 commit comments