From 03c0e3024c80fce1c0001ee5bf83808c0119155a Mon Sep 17 00:00:00 2001 From: Josh Megnauth Date: Thu, 18 Sep 2025 02:38:15 -0400 Subject: [PATCH] Export fexecve It turns out we have fexecve but it wasn't exported in unistd.h. Related: #184 --- src/header/unistd/mod.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/header/unistd/mod.rs b/src/header/unistd/mod.rs index 46617a3b2e..12a7b4d6da 100644 --- a/src/header/unistd/mod.rs +++ b/src/header/unistd/mod.rs @@ -344,6 +344,18 @@ pub unsafe extern "C" fn execve( .or_minus_one_errno() } +/// See . +#[no_mangle] +pub unsafe extern "C" fn fexecve( + fd: c_int, + argv: *const *mut c_char, + envp: *const *mut c_char, +) -> c_int { + Sys::fexecve(fd, argv, envp) + .map(|()| unreachable!()) + .or_minus_one_errno() +} + #[cfg(target_os = "linux")] const PATH_SEPARATOR: u8 = b':';