Skip to content

Commit 6f4ad51

Browse files
author
Xing Xue
committed
changed to *const *mut in execv* functions for AIX.
1 parent 0990932 commit 6f4ad51

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

src/unix/aix/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2900,10 +2900,7 @@ extern "C" {
29002900
pub fn faccessat(dirfd: c_int, pathname: *const c_char, mode: c_int, flags: c_int) -> c_int;
29012901
pub fn fattach(fildes: c_int, path: *const c_char) -> c_int;
29022902
pub fn fdatasync(fd: c_int) -> c_int;
2903-
2904-
// DIFF(main): changed to `*const *mut` in e77f551de9
2905-
pub fn fexecve(fd: c_int, argv: *const *const c_char, envp: *const *const c_char) -> c_int;
2906-
2903+
pub fn fexecve(fd: c_int, argv: *const *mut c_char, envp: *const *mut c_char) -> c_int;
29072904
pub fn ffs(value: c_int) -> c_int;
29082905
pub fn ffsl(value: c_long) -> c_int;
29092906
pub fn ffsll(value: c_longlong) -> c_int;

src/unix/mod.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,13 +1013,28 @@ extern "C" {
10131013
pub fn execle(path: *const c_char, arg0: *const c_char, ...) -> c_int;
10141014
pub fn execlp(file: *const c_char, arg0: *const c_char, ...) -> c_int;
10151015

1016+
#[cfg(target_os = "aix")]
1017+
pub fn execv(prog: *const c_char, argv: *const *mut c_char) -> c_int;
1018+
#[cfg(not(target_os = "aix"))]
10161019
// DIFF(main): changed to `*const *mut` in e77f551de9
10171020
pub fn execv(prog: *const c_char, argv: *const *const c_char) -> c_int;
1021+
#[cfg(target_os = "aix")]
1022+
pub fn execve(
1023+
prog: *const c_char,
1024+
argv: *const *mut c_char,
1025+
envp: *const *mut c_char,
1026+
) -> c_int;
1027+
#[cfg(not(target_os = "aix"))]
1028+
// DIFF(main): changed to `*const *mut` in e77f551de9
10181029
pub fn execve(
10191030
prog: *const c_char,
10201031
argv: *const *const c_char,
10211032
envp: *const *const c_char,
10221033
) -> c_int;
1034+
#[cfg(target_os = "aix")]
1035+
pub fn execvp(c: *const c_char, argv: *const *mut c_char) -> c_int;
1036+
#[cfg(not(target_os = "aix"))]
1037+
// DIFF(main): changed to `*const *mut` in e77f551de9
10231038
pub fn execvp(c: *const c_char, argv: *const *const c_char) -> c_int;
10241039

10251040
pub fn fork() -> pid_t;

0 commit comments

Comments
 (0)