@@ -5,7 +5,14 @@ extern crate libc;
55use libc:: { c_uchar, c_uint, c_void, cmsghdr, msghdr} ;
66use std:: { mem, ptr} ;
77
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+
916extern {
1017 pub fn cmsg_firsthdr ( msgh : * const msghdr ) -> * mut cmsghdr ;
1118 pub fn cmsg_nxthdr ( mhdr : * const msghdr ,
@@ -15,7 +22,6 @@ extern {
1522 pub fn cmsg_data ( cmsg : * const cmsghdr ) -> * mut c_uchar ;
1623}
1724
18- #[ cfg( unix) ]
1925#[ test]
2026fn test_cmsg_data ( ) {
2127 for l in 0 ..128 {
@@ -26,7 +32,6 @@ fn test_cmsg_data() {
2632 }
2733}
2834
29- #[ cfg( unix) ]
3035#[ test]
3136fn test_cmsg_firsthdr ( ) {
3237 let mut mhdr: msghdr = unsafe { mem:: zeroed ( ) } ;
@@ -40,7 +45,6 @@ fn test_cmsg_firsthdr() {
4045 }
4146}
4247
43- #[ cfg( unix) ]
4448#[ test]
4549fn test_cmsg_len ( ) {
4650 for l in 0 ..128 {
@@ -50,7 +54,6 @@ fn test_cmsg_len() {
5054 }
5155}
5256
53- #[ cfg( unix) ]
5457#[ test]
5558fn test_cmsg_nxthdr ( ) {
5659 let mut buffer = [ 0u8 ; 256 ] ;
@@ -83,7 +86,6 @@ fn test_cmsg_nxthdr() {
8386 }
8487}
8588
86- #[ cfg( unix) ]
8789#[ test]
8890fn test_cmsg_space ( ) {
8991 unsafe {
@@ -92,3 +94,5 @@ fn test_cmsg_space() {
9294 }
9395 }
9496}
97+
98+ }
0 commit comments