Skip to content

Read/write I/O timeouts #13814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/libnative/io/c_unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ pub static FIOCLEX: libc::c_ulong = 0x20006601;
#[cfg(target_os = "android")]
pub static FIOCLEX: libc::c_ulong = 0x5451;

#[cfg(target_os = "macos")]
#[cfg(target_os = "freebsd")]
pub static MSG_DONTWAIT: libc::c_int = 0x80;
#[cfg(target_os = "linux")]
#[cfg(target_os = "android")]
pub static MSG_DONTWAIT: libc::c_int = 0x40;

extern {
pub fn gettimeofday(timeval: *mut libc::timeval,
tzp: *libc::c_void) -> libc::c_int;
Expand Down
1 change: 1 addition & 0 deletions src/libnative/io/c_win32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pub static WSADESCRIPTION_LEN: uint = 256;
pub static WSASYS_STATUS_LEN: uint = 128;
pub static FIONBIO: libc::c_long = 0x8004667e;
static FD_SETSIZE: uint = 64;
pub static MSG_DONTWAIT: libc::c_int = 0;

pub struct WSADATA {
pub wVersion: libc::WORD,
Expand Down
3 changes: 3 additions & 0 deletions src/libnative/io/file_unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ impl rtio::RtioPipe for FileDesc {
fn close_write(&mut self) -> Result<(), IoError> {
Err(io::standard_error(io::InvalidInput))
}
fn set_timeout(&mut self, _t: Option<u64>) {}
fn set_read_timeout(&mut self, _t: Option<u64>) {}
fn set_write_timeout(&mut self, _t: Option<u64>) {}
}

impl rtio::RtioTTY for FileDesc {
Expand Down
3 changes: 3 additions & 0 deletions src/libnative/io/file_win32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ impl rtio::RtioPipe for FileDesc {
fn close_write(&mut self) -> IoResult<()> {
Err(io::standard_error(io::InvalidInput))
}
fn set_timeout(&mut self, _t: Option<u64>) {}
fn set_read_timeout(&mut self, _t: Option<u64>) {}
fn set_write_timeout(&mut self, _t: Option<u64>) {}
}

impl rtio::RtioTTY for FileDesc {
Expand Down
Loading