Skip to content

Commit 3e952d3

Browse files
bors[bot]rtzoeller
andauthored
Merge #1577
1577: DragonFly 6.0 added fexecve(2) r=rtzoeller a=rtzoeller Enable `fexecve()` on DragonFly, as it was added in the 6.0 release. Co-authored-by: Ryan Zoeller <[email protected]>
2 parents 8eac0ee + 2eb6e88 commit 3e952d3

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
66
## [Unreleased] - ReleaseDate
77
### Added
88

9+
- Added `fexecve` on DragonFly.
10+
(#[1577](https://github.com/nix-rust/nix/pull/1577))
911
- Added fine-grained features flags. Most Nix functionality can now be
1012
conditionally enabled. By default, all features are enabled.
1113
(#[1611](https://github.com/nix-rust/nix/pull/1611))

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ targets = [
2727
]
2828

2929
[dependencies]
30-
libc = { version = "0.2.102", features = [ "extra_traits" ] }
30+
libc = { version = "0.2.112", features = [ "extra_traits" ] }
3131
bitflags = "1.1"
3232
cfg-if = "1.0"
3333

src/unistd.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -848,11 +848,9 @@ pub fn execvpe<SA: AsRef<CStr>, SE: AsRef<CStr>>(filename: &CStr, args: &[SA], e
848848
///
849849
/// This function is similar to `execve`, except that the program to be executed
850850
/// is referenced as a file descriptor instead of a path.
851-
// Note for NetBSD and OpenBSD: although rust-lang/libc includes it (under
852-
// unix/bsd/netbsdlike/) fexecve is not currently implemented on NetBSD nor on
853-
// OpenBSD.
854851
#[cfg(any(target_os = "android",
855852
target_os = "linux",
853+
target_os = "dragonfly",
856854
target_os = "freebsd"))]
857855
#[inline]
858856
pub fn fexecve<SA: AsRef<CStr> ,SE: AsRef<CStr>>(fd: RawFd, args: &[SA], env: &[SE]) -> Result<Infallible> {

test/test_unistd.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -363,25 +363,21 @@ cfg_if!{
363363
if #[cfg(target_os = "android")] {
364364
execve_test_factory!(test_execve, execve, CString::new("/system/bin/sh").unwrap().as_c_str());
365365
execve_test_factory!(test_fexecve, fexecve, File::open("/system/bin/sh").unwrap().into_raw_fd());
366-
} else if #[cfg(any(target_os = "freebsd",
366+
} else if #[cfg(any(target_os = "dragonfly",
367+
target_os = "freebsd",
367368
target_os = "linux"))] {
368369
// These tests frequently fail on musl, probably due to
369370
// https://github.com/nix-rust/nix/issues/555
370371
execve_test_factory!(test_execve, execve, CString::new("/bin/sh").unwrap().as_c_str());
371372
execve_test_factory!(test_fexecve, fexecve, File::open("/bin/sh").unwrap().into_raw_fd());
372-
} else if #[cfg(any(target_os = "dragonfly",
373-
target_os = "illumos",
373+
} else if #[cfg(any(target_os = "illumos",
374374
target_os = "ios",
375375
target_os = "macos",
376376
target_os = "netbsd",
377377
target_os = "openbsd",
378378
target_os = "solaris"))] {
379379
execve_test_factory!(test_execve, execve, CString::new("/bin/sh").unwrap().as_c_str());
380-
// No fexecve() on DragonFly, ios, macos, NetBSD, OpenBSD.
381-
//
382-
// Note for NetBSD and OpenBSD: although rust-lang/libc includes it
383-
// (under unix/bsd/netbsdlike/) fexecve is not currently implemented on
384-
// NetBSD nor on OpenBSD.
380+
// No fexecve() on ios, macos, NetBSD, OpenBSD.
385381
}
386382
}
387383

0 commit comments

Comments
 (0)