Skip to content

Commit

Permalink
Auto merge of #2467 - rtzoeller:dfly_fexecve, r=JohnTitor
Browse files Browse the repository at this point in the history
Add fexecve() to DragonFly

DragonFly 6.0 added support for `fexecve(2)`.

Implementing it with a mismatched signature from what C exposes, as outlined in #1272, for consistency with other platforms.

Tested with nix-rust/nix#1577
  • Loading branch information
bors committed Oct 21, 2021
2 parents f6084a7 + 6f0857d commit 1045d01
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion libc-test/build.rs
Expand Up @@ -1336,7 +1336,7 @@ fn test_dragonflybsd(target: &str) {
// skip those that are manually verified
match name {
// FIXME: https://github.com/rust-lang/libc/issues/1272
"execv" | "execve" | "execvp" => true,
"execv" | "execve" | "execvp" | "fexecve" => true,

"getrlimit" | "getrlimit64" | // non-int in 1st arg
"setrlimit" | "setrlimit64" | // non-int in 1st arg
Expand Down
1 change: 1 addition & 0 deletions libc-test/semver/dragonfly.txt
Expand Up @@ -1227,6 +1227,7 @@ faccessat
fchdir
fchflags
fdopendir
fexecve
fmemopen
forkpty
fparseln
Expand Down
5 changes: 0 additions & 5 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Expand Up @@ -2130,11 +2130,6 @@ extern "C" {
msgflg: ::c_int,
) -> ::c_int;
pub fn cfmakesane(termios: *mut ::termios);
pub fn fexecve(
fd: ::c_int,
argv: *const *const ::c_char,
envp: *const *const ::c_char,
) -> ::c_int;

pub fn pdfork(fdp: *mut ::c_int, flags: ::c_int) -> ::pid_t;
pub fn pdgetpid(fd: ::c_int, pidp: *mut ::pid_t) -> ::c_int;
Expand Down
5 changes: 5 additions & 0 deletions src/unix/bsd/freebsdlike/mod.rs
Expand Up @@ -1441,6 +1441,11 @@ extern "C" {
pub fn duplocale(base: ::locale_t) -> ::locale_t;
pub fn endutxent();
pub fn fchflags(fd: ::c_int, flags: ::c_ulong) -> ::c_int;
pub fn fexecve(
fd: ::c_int,
argv: *const *const ::c_char,
envp: *const *const ::c_char,
) -> ::c_int;
pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
pub fn getdomainname(name: *mut ::c_char, len: ::c_int) -> ::c_int;
pub fn getgrent_r(
Expand Down

0 comments on commit 1045d01

Please sign in to comment.