Skip to content

Commit 858d47c

Browse files
committed
unix: add fexecve()
Add missing fexecve() - execute program specified via file descriptor. Reference: http://pubs.opengroup.org/onlinepubs/9699919799/functions/fexecve.html
1 parent 516df7f commit 858d47c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

libc-test/build.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,8 @@ fn main() {
457457
"execv" | // crazy stuff with const/mut
458458
"execve" |
459459
"execvp" |
460-
"execvpe" => true,
460+
"execvpe" |
461+
"fexecve" => true,
461462

462463
"getrlimit" | "getrlimit64" | // non-int in 1st arg
463464
"setrlimit" | "setrlimit64" | // non-int in 1st arg

src/unix/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,9 @@ extern {
449449
-> ::c_int;
450450
pub fn execvp(c: *const c_char,
451451
argv: *const *const c_char) -> ::c_int;
452+
pub fn fexecve(fd: ::c_int, argv: *const *const c_char,
453+
envp: *const *const c_char)
454+
-> ::c_int;
452455
pub fn fork() -> pid_t;
453456
pub fn fpathconf(filedes: ::c_int, name: ::c_int) -> c_long;
454457
pub fn getcwd(buf: *mut c_char, size: ::size_t) -> *mut c_char;

0 commit comments

Comments
 (0)