From bdca86b8f779ca258106c44ba380c0bd508ce911 Mon Sep 17 00:00:00 2001 From: Andrei-Marius Radu Date: Mon, 14 Jan 2019 22:18:06 +0200 Subject: Fix build and tests issues on OpenBSD 6.4+ 1) lutimes doesn't exist on OpenBSD so it needs to be under conditional compilation. The only "reference" that I could find related to this is the discussion here: https://github.com/rust-lang/libc/pull/790 . 2) fexecve doesn't exist on OpenBSD so add conditional compilation for it in unistd and in related tests. The only "reference" that I could find is a mention that fexecve is not implemented on OpenBSD in the manual pages for signal(3) and sigaction(2): Official repository (search for "fexecve"): https://cvsweb.openbsd.org/src/lib/libc/sys/sigaction.2?rev=1.75&content-type=text/x-cvsweb-markup Github mirror: https://github.com/openbsd/src/blob/master/lib/libc/sys/sigaction.2#L619 3) AIO doesn't work on OpenBSD so put test_aio_drop under conditional compilation. 4) Add relevant changelog entries. P.S. On OpenBSD remains the issue of test_scm_rights which builds correctly but fails at runtime. --- test/test_stat.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'test/test_stat.rs') diff --git a/test/test_stat.rs b/test/test_stat.rs index 9d27ce79..fae8df82 100644 --- a/test/test_stat.rs +++ b/test/test_stat.rs @@ -7,7 +7,14 @@ use std::time::{Duration, UNIX_EPOCH}; use libc::{S_IFMT, S_IFLNK}; use nix::fcntl; -use nix::sys::stat::{self, fchmod, fchmodat, futimens, lutimes, stat, utimes, utimensat}; +use nix::sys::stat::{self, fchmod, fchmodat, futimens, stat, utimes, utimensat}; +#[cfg(any(target_os = "linux", + target_os = "haiku", + target_os = "ios", + target_os = "macos", + target_os = "freebsd", + target_os = "netbsd"))] +use nix::sys::stat::lutimes; use nix::sys::stat::{Mode, FchmodatFlags, UtimensatFlags}; #[cfg(not(any(target_os = "netbsd")))] @@ -196,6 +203,12 @@ fn test_utimes() { } #[test] +#[cfg(any(target_os = "linux", + target_os = "haiku", + target_os = "ios", + target_os = "macos", + target_os = "freebsd", + target_os = "netbsd"))] fn test_lutimes() { let tempdir = tempfile::tempdir().unwrap(); let target = tempdir.path().join("target"); -- cgit v1.2.3