summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Somers <asomers@gmail.com>2016-11-13 13:52:34 -0700
committerAlan Somers <asomers@gmail.com>2016-11-13 13:52:34 -0700
commit9245e0727b422b3490ec401e4601d3cf1c443ccc (patch)
tree69ce04b31e77fa95ba0d7597531dd9804784f5d2
parent4ec884ac6dc837ee4398ae5a5dfdbc525a4c7ac0 (diff)
downloadrust-libc-9245e0727b422b3490ec401e4601d3cf1c443ccc.tar.gz
Fix various CI errors in PR #449
-rw-r--r--libc-test/build.rs17
-rw-r--r--src/unix/bsd/apple/mod.rs2
-rw-r--r--src/unix/bsd/freebsdlike/dragonfly/mod.rs2
-rw-r--r--src/unix/bsd/freebsdlike/freebsd/mod.rs2
-rw-r--r--src/unix/bsd/netbsdlike/netbsd/mod.rs2
-rw-r--r--src/unix/mod.rs5
-rw-r--r--src/unix/notbsd/mod.rs8
7 files changed, 28 insertions, 10 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 29f9d36242..d2c98ae387 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -298,6 +298,9 @@ fn main() {
// The alignment of this is 4 on 64-bit OSX...
"kevent" if apple && x86_64 => true,
+ // This is actually a union, not a struct
+ "sigval" => true,
+
_ => false
}
});
@@ -427,6 +430,10 @@ fn main() {
// the symbol.
"uname" if freebsd => true,
+ // lio_listio confuses the checker, probably because one of its
+ // arguments is an array
+ "lio_listio" if freebsd => true,
+
_ => false,
}
});
@@ -446,7 +453,11 @@ fn main() {
// sighandler_t type is super weird
(struct_ == "sigaction" && field == "sa_sigaction") ||
// __timeval type is a patch which doesn't exist in glibc
- (linux && struct_ == "utmpx" && field == "ut_tv")
+ (linux && struct_ == "utmpx" && field == "ut_tv") ||
+ // sigval is actually a union, but we pretend it's a struct
+ (struct_ == "sigevent" && field == "sigev_value") ||
+ // aio_buf is "volatile void*" and Rust doesn't understand volatile
+ (struct_ == "aiocb" && field == "aio_buf")
});
cfg.skip_field(move |struct_, field| {
@@ -456,7 +467,9 @@ fn main() {
// musl names this __dummy1 but it's still there
(musl && struct_ == "glob_t" && field == "gl_flags") ||
// musl seems to define this as an *anonymous* bitfield
- (musl && struct_ == "statvfs" && field == "__f_unused")
+ (musl && struct_ == "statvfs" && field == "__f_unused") ||
+ // sigev_notify_thread_id is actually part of a sigev_un union
+ (struct_ == "sigevent" && field == "sigev_notify_thread_id")
});
cfg.fn_cname(move |name, cname| {
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index a88c8b54eb..055fbd71b9 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -317,7 +317,7 @@ s! {
pub struct sigevent {
pub sigev_notify: ::c_int,
pub sigev_signo: ::c_int,
- pub sigev_value: ::intptr_t, //actually a union of int and void*
+ pub sigev_value: ::sigval,
__unused1: *mut ::c_void, //actually a function pointer
pub sigev_notify_attributes: *mut ::pthread_attr_t
}
diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
index fbfb1c4899..3a91bca008 100644
--- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs
+++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
@@ -50,7 +50,7 @@ s! {
pub sigev_signo: ::c_int, //actually a union
#[cfg(target_pointer_width = "64")]
__unused1: ::c_int,
- pub sigev_value: ::intptr_t, //actually a union of int and void*
+ pub sigev_value: ::sigval,
__unused2: *mut ::c_void //actually a function pointer
}
diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs
index 706aea65c3..173f838373 100644
--- a/src/unix/bsd/freebsdlike/freebsd/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs
@@ -37,7 +37,7 @@ s! {
pub struct sigevent {
pub sigev_notify: ::c_int,
pub sigev_signo: ::c_int,
- pub sigev_value: ::intptr_t, //actually a union of int and void*
+ pub sigev_value: ::sigval,
//The rest of the structure is actually a union. We expose only
//sigev_notify_thread_id because it's the most useful union member.
pub sigev_notify_thread_id: ::lwpid_t,
diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs
index 82f938e050..cb82f813b9 100644
--- a/src/unix/bsd/netbsdlike/netbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -46,7 +46,7 @@ s! {
pub struct sigevent {
pub sigev_notify: ::c_int,
pub sigev_signo: ::c_int,
- pub sigev_value: ::intptr_t, //actually a union of int and void*
+ pub sigev_value: ::sigval,
__unused1: *mut ::c_void, //actually a function pointer
pub sigev_notify_attributes: *mut ::c_void
}
diff --git a/src/unix/mod.rs b/src/unix/mod.rs
index b79bb9f8c5..cf3a87ab48 100644
--- a/src/unix/mod.rs
+++ b/src/unix/mod.rs
@@ -119,6 +119,11 @@ s! {
pub l_onoff: ::c_int,
pub l_linger: ::c_int,
}
+
+ pub struct sigval {
+ // Actually a union of an int and a void*
+ pub sival_ptr: *mut ::c_void
+ }
}
pub const SIG_DFL: sighandler_t = 0 as sighandler_t;
diff --git a/src/unix/notbsd/mod.rs b/src/unix/notbsd/mod.rs
index 4d1ed88645..92080f68a7 100644
--- a/src/unix/notbsd/mod.rs
+++ b/src/unix/notbsd/mod.rs
@@ -165,12 +165,12 @@ s! {
}
pub struct sigevent {
- pub sigev_value: ::intptr_t, //actually a union of int and void*
+ pub sigev_value: ::sigval,
pub sigev_signo: ::c_int,
pub sigev_notify: ::c_int,
- // Actually a union. We only expose _tid because it's the most useful
- // member
- pub _tid: ::c_int,
+ // Actually a union. We only expose sigev_notify_thread_id because it's
+ // the most useful member
+ pub sigev_notify_thread_id: ::c_int,
#[cfg(target_pointer_width = "64")]
__unused1: [::c_int; 11],
#[cfg(target_pointer_width = "32")]