Skip to content

Commit

Permalink
Disable lio_listio on apple, because it doesn't seem to work
Browse files Browse the repository at this point in the history
  • Loading branch information
asomers committed Dec 4, 2016
1 parent 7e1a617 commit dd0b6c2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
6 changes: 1 addition & 5 deletions src/errno.rs
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ mod consts {
pub fn from_i32(e: i32) -> Errno {
use self::Errno::*;

let errno = match e {
match e {
0 => UnknownErrno,
1 => EPERM,
2 => ENOENT,
Expand Down Expand Up @@ -1039,11 +1039,7 @@ mod consts {
105 => EOWNERDEAD,
106 => EQFULL,
_ => UnknownErrno,
};
if errno == UnknownErrno {
println!("Something returned unknown errno {:?}", e);
}
errno
}
}

Expand Down
5 changes: 2 additions & 3 deletions src/sys/aio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ pub fn aio_write(aiocb: &mut AioCb) -> Result<()> {

/// Submits multiple asynchronous I/O requests with a single system call. The
/// order in which the requests are carried out is not specified.
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
pub fn lio_listio(mode: LioMode, list: &[&mut AioCb],
sigev_notify: SigevNotify) -> Result<()> {
let sigev = SigEvent::new(sigev_notify);
Expand All @@ -241,8 +242,6 @@ pub fn lio_listio(mode: LioMode, list: &[&mut AioCb],
};
let p = plist as *const *mut libc::aiocb;
Errno::result(unsafe {
let err = libc::lio_listio(mode as i32, p, list.len() as i32, sigevp);
println!("lio_listio returned {:?}", err);
err
libc::lio_listio(mode as i32, p, list.len() as i32, sigevp)
}).map(drop)
}
3 changes: 3 additions & 0 deletions test/sys/test_aio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ fn test_aio_write_sigev_signal() {
// Test lio_listio with LIO_WAIT, so all AIO ops should be complete by the time
// lio_listio returns.
#[test]
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
fn test_lio_listio_wait() {
const INITIAL: &'static [u8] = b"abcdef123456";
const WBUF: &'static [u8] = b"CDEF";
Expand Down Expand Up @@ -274,6 +275,7 @@ fn test_lio_listio_wait() {
// Test lio_listio with LIO_NOWAIT and no SigEvent, so we must use some other
// mechanism to check for the individual AioCb's completion.
#[test]
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
fn test_lio_listio_nowait() {
const INITIAL: &'static [u8] = b"abcdef123456";
const WBUF: &'static [u8] = b"CDEF";
Expand Down Expand Up @@ -320,6 +322,7 @@ fn test_lio_listio_nowait() {
// Test lio_listio with LIO_NOWAIT and a SigEvent to indicate when all AioCb's
// are complete.
#[test]
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
fn test_lio_listio_signal() {
const INITIAL: &'static [u8] = b"abcdef123456";
const WBUF: &'static [u8] = b"CDEF";
Expand Down

0 comments on commit dd0b6c2

Please sign in to comment.