From e0ff0d61854b5dfcd58aec4d081c3a58618b5623 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Sun, 13 Nov 2016 14:35:17 -0700 Subject: [PATCH] Fix more CI errors in PR #449 --- libc-test/build.rs | 4 ++++ src/unix/bsd/apple/mod.rs | 2 +- src/unix/bsd/netbsdlike/netbsd/mod.rs | 1 - src/unix/notbsd/linux/mod.rs | 29 +++++++++++++++++++++++++++ src/unix/notbsd/mod.rs | 28 +------------------------- 5 files changed, 35 insertions(+), 29 deletions(-) diff --git a/libc-test/build.rs b/libc-test/build.rs index d2c98ae3..a1bd3d98 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -430,9 +430,13 @@ fn main() { // the symbol. "uname" if freebsd => true, + // aio_waitcomplete's return type changed between FreeBSD 10 and 11. + "aio_waitcomplete" if freebsd => true, + // lio_listio confuses the checker, probably because one of its // arguments is an array "lio_listio" if freebsd => true, + "lio_listio" if musl => true, _ => false, } diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 055fbd71..d83c4cc1 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -29,7 +29,7 @@ s! { pub aio_fildes: ::c_int, pub aio_offset: ::off_t, pub aio_buf: *mut ::c_void, - pub aio_nybtes: ::size_t, + pub aio_nbytes: ::size_t, pub aio_reqprio: ::c_int, pub aio_sigevent: sigevent, pub aio_lio_opcode: ::c_int diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs index cb82f813..4092a2e3 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -570,7 +570,6 @@ pub const KERN_PROC_RGID: ::c_int = 8; pub const EAI_SYSTEM: ::c_int = 11; -pub const AIO_LISTIO_MAX: ::c_int = 512; pub const AIO_CANCELED: ::c_int = 1; pub const AIO_NOTCANCELED: ::c_int = 2; pub const AIO_ALLDONE: ::c_int = 3; diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs index eff697aa..d477d09e 100644 --- a/src/unix/notbsd/linux/mod.rs +++ b/src/unix/notbsd/linux/mod.rs @@ -21,6 +21,24 @@ pub type nl_item = ::c_int; pub enum fpos64_t {} // TODO: fill this out with a struct s! { + pub struct aiocb { + pub aio_fildes: ::c_int, + pub aio_lio_opcode: ::c_int, + pub aio_reqprio: ::c_int, + pub aio_buf: *mut ::c_void, + pub aio_nbytes: ::size_t, + pub aio_sigevent: ::sigevent, + __next_prio: *mut aiocb, + __abs_prio: ::c_int, + __policy: ::c_int, + __error_code: ::c_int, + __return_value: ::ssize_t, + pub aio_offset: off_t, + #[cfg(target_pointer_width = "32")] + __unused1: [::c_char; 4], + __glibc_reserved: [::c_char; 32] + } + pub struct dirent { pub d_ino: ::ino_t, pub d_off: ::off_t, @@ -557,6 +575,17 @@ f! { } extern { + pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int; + pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int; + pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int; + pub fn aio_error(aiocbp: *const aiocb) -> ::c_int; + pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t; + pub fn aio_suspend(aiocb_list: *const *const aiocb, nitems: ::c_int, + timeout: *const ::timespec) -> ::c_int; + pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int; + pub fn lio_listio(mode: ::c_int, aiocb_list: *const *mut aiocb, + nitems: ::c_int, sevp: *mut ::sigevent) -> ::c_int; + pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int; pub fn setpwent(); diff --git a/src/unix/notbsd/mod.rs b/src/unix/notbsd/mod.rs index 92080f68..f0fda268 100644 --- a/src/unix/notbsd/mod.rs +++ b/src/unix/notbsd/mod.rs @@ -176,22 +176,6 @@ s! { #[cfg(target_pointer_width = "32")] __unused1: [::c_int; 12] } - - pub struct aiocb { - pub aio_fildes: ::c_int, - pub aio_lio_opcode: ::c_int, - pub aio_reqprio: ::c_int, - pub aio_buf: *mut ::c_void, - pub aio_nbytes: ::size_t, - pub aio_sigevent: sigevent, - __next_prio: *mut aiocb, - __abs_prio: ::c_int, - __policy: ::c_int, - __error_code: ::c_int, - __return_value: ::ssize_t, - pub aio_offset: off_t, - __glibc_reserved: [::c_char; 32] - } } // intentionally not public, only used for fd_set @@ -664,6 +648,7 @@ pub const SI_LOAD_SHIFT: ::c_uint = 16; pub const SIGEV_SIGNAL: ::c_int = 0; pub const SIGEV_NONE: ::c_int = 1; pub const SIGEV_THREAD: ::c_int = 2; +#[cfg(not(any(target_env = "musl")))] pub const SIGEV_THREAD_ID: ::c_int = 4; pub const AIO_CANCELED: ::c_int = 0; @@ -732,17 +717,6 @@ f! { } extern { - pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int; - pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int; - pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int; - pub fn aio_error(aiocbp: *const aiocb) -> ::c_int; - pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t; - pub fn aio_suspend(aiocb_list: *const *const aiocb, nitems: ::c_int, - timeout: *const ::timespec) -> ::c_int; - pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int; - pub fn lio_listio(mode: ::c_int, aiocb_list: *const *mut aiocb, - nitems: ::c_int, sevp: *mut sigevent) -> ::c_int; - pub fn getpwnam_r(name: *const ::c_char, pwd: *mut passwd, buf: *mut ::c_char,