diff --git a/.travis.yml b/.travis.yml index fcef85e9c6..79606c5a1a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -102,9 +102,10 @@ matrix: name: redox script: - curl --proto '=https' --tlsv1.2 -sSf --output rustup.sh https://sh.rustup.rs - - sh rustup.sh -y --profile=minimal --default-toolchain 1.36.0 --target x86_64-unknown-redox + # if stuff breaks, change nightly to the date in the toolchain_* directory at https://static.redox-os.org + - sh rustup.sh -y --profile=minimal --default-toolchain nightly-2020-08-04 --target x86_64-unknown-redox - . $HOME/.cargo/env - - cargo build --all-targets + - cargo build --target x86_64-unknown-redox --all-targets before_install: set -e diff --git a/CHANGELOG.md b/CHANGELOG.md index 56abe869c8..d1c1ed6249 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Added `mremap` (#[1306](https://github.com/nix-rust/nix/pull/1306)) ### Fixed +- Fixed compilation on Redox + (#[1327](https://github.com/nix-rust/nix/pull/1327)) ### Changed ### Removed diff --git a/src/time.rs b/src/time.rs index 54989c2e28..e6c3f8ded5 100644 --- a/src/time.rs +++ b/src/time.rs @@ -37,6 +37,7 @@ impl ClockId { } /// Returns resolution of the clock id + #[cfg(not(target_os = "redox"))] pub fn res(self) -> Result { clock_getres(self) } @@ -204,6 +205,7 @@ impl std::fmt::Display for ClockId { /// Get the resolution of the specified clock, (see /// [clock_getres(2)](https://pubs.opengroup.org/onlinepubs/7908799/xsh/clock_getres.html)). +#[cfg(not(target_os = "redox"))] pub fn clock_getres(clock_id: ClockId) -> Result { let mut c_time: MaybeUninit = MaybeUninit::uninit(); let ret = unsafe { libc::clock_getres(clock_id.as_raw(), c_time.as_mut_ptr()) };