Skip to content
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

Timespec #475

Merged
merged 5 commits into from
Dec 2, 2016
Merged
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]

### Added
- Added struct `TimeSpec`
([#475](https://github.com/nix-rust/nix/pull/475))
- Added complete definitions for all kqueue-related constants on all supported
OSes
([#415](https://github.com/nix-rust/nix/pull/415))
Expand All @@ -22,6 +24,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
([#457](https://github.com/nix-rust/nix/pull/457))

### Changed
- Changed `TimeVal` into an opaque Newtype
([#475](https://github.com/nix-rust/nix/pull/475))
- `kill`'s signature, defined in `::nix::sys::signal`, changed, so that the
signal parameter has type `T: Into<Option<Signal>>`. `None` as an argument
for that parameter will result in a 0 passed to libc's `kill`, while a
Expand Down
10 changes: 5 additions & 5 deletions src/sys/select.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::ptr::null_mut;
use std::os::unix::io::RawFd;
use libc::c_int;
use libc::{c_int, timeval};
use {Errno, Result};
use sys::time::TimeVal;

Expand Down Expand Up @@ -56,16 +56,15 @@ impl FdSet {
}

mod ffi {
use libc::c_int;
use sys::time::TimeVal;
use libc::{c_int, timeval};
use super::FdSet;

extern {
pub fn select(nfds: c_int,
readfds: *mut FdSet,
writefds: *mut FdSet,
errorfds: *mut FdSet,
timeout: *mut TimeVal) -> c_int;
timeout: *mut timeval) -> c_int;
}
}

Expand All @@ -77,7 +76,8 @@ pub fn select(nfds: c_int,
let readfds = readfds.map(|set| set as *mut FdSet).unwrap_or(null_mut());
let writefds = writefds.map(|set| set as *mut FdSet).unwrap_or(null_mut());
let errorfds = errorfds.map(|set| set as *mut FdSet).unwrap_or(null_mut());
let timeout = timeout.map(|tv| tv as *mut TimeVal).unwrap_or(null_mut());
let timeout = timeout.map(|tv| tv as *mut TimeVal as *mut timeval)
.unwrap_or(null_mut());

let res = unsafe {
ffi::select(nfds, readfds, writefds, errorfds, timeout)
Expand Down
Loading