From 10ae905fa4c7fa25c895add67ecd4e4dcbaad73a Mon Sep 17 00:00:00 2001 From: Ignas Brasiskis Date: Wed, 9 Jul 2025 16:52:45 +0300 Subject: [PATCH 1/2] AIX stat apis to accept const paths in similar manner to other unix declarations --- src/unix/aix/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/unix/aix/mod.rs b/src/unix/aix/mod.rs index a25b480cd540..5f681c1d46dc 100644 --- a/src/unix/aix/mod.rs +++ b/src/unix/aix/mod.rs @@ -3281,10 +3281,10 @@ extern "C" { pub fn srand48(seed: c_long); pub fn stat64(path: *const c_char, buf: *mut stat64) -> c_int; pub fn stat64at(dirfd: c_int, path: *const c_char, buf: *mut stat64, flags: c_int) -> c_int; - pub fn statfs(path: *mut c_char, buf: *mut statfs) -> c_int; - pub fn statfs64(path: *mut c_char, buf: *mut statfs64) -> c_int; + pub fn statfs(path: *const c_char, buf: *mut statfs) -> c_int; + pub fn statfs64(path: *const c_char, buf: *mut statfs64) -> c_int; pub fn statvfs64(path: *const c_char, buf: *mut statvfs64) -> c_int; - pub fn statx(path: *mut c_char, buf: *mut stat, length: c_int, command: c_int) -> c_int; + pub fn statx(path: *const c_char, buf: *mut stat, length: c_int, command: c_int) -> c_int; pub fn strcasecmp_l( string1: *const c_char, string2: *const c_char, From 673abcfba2de90ee4c9f77aab66ff656afd4f214 Mon Sep 17 00:00:00 2001 From: Ignas Brasiskis Date: Wed, 9 Jul 2025 17:39:52 +0300 Subject: [PATCH 2/2] Returned const to other apis. --- src/unix/aix/mod.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/unix/aix/mod.rs b/src/unix/aix/mod.rs index 5f681c1d46dc..b196d5c3da4a 100644 --- a/src/unix/aix/mod.rs +++ b/src/unix/aix/mod.rs @@ -3246,7 +3246,7 @@ extern "C" { #[link_name = "nsendmsg"] pub fn sendmsg(sockfd: c_int, msg: *const msghdr, flags: c_int) -> ssize_t; pub fn setcontext(ucp: *const ucontext_t) -> c_int; - pub fn setdomainname(name: *mut c_char, len: c_int) -> c_int; + pub fn setdomainname(name: *const c_char, len: c_int) -> c_int; pub fn setgroups(ngroups: c_int, ptr: *mut crate::gid_t) -> c_int; pub fn setgrent(); pub fn setmntent(filename: *const c_char, ty: *const c_char) -> *mut crate::FILE; @@ -3254,7 +3254,7 @@ extern "C" { pub fn setpwent(); pub fn setrlimit(resource: c_int, rlim: *const crate::rlimit) -> c_int; pub fn setrlimit64(resource: c_int, rlim: *const rlimit64) -> c_int; - pub fn settimeofday(tv: *mut crate::timeval, tz: *mut crate::timezone) -> c_int; + pub fn settimeofday(tv: *const crate::timeval, tz: *mut crate::timezone) -> c_int; pub fn setitimer( which: c_int, new_value: *const crate::itimerval, @@ -3306,8 +3306,8 @@ extern "C" { pub fn strptime(s: *const c_char, format: *const c_char, tm: *mut crate::tm) -> *mut c_char; pub fn strsep(string: *mut *mut c_char, delim: *const c_char) -> *mut c_char; pub fn swapcontext(uocp: *mut ucontext_t, ucp: *const ucontext_t) -> c_int; - pub fn swapoff(puath: *mut c_char) -> c_int; - pub fn swapon(path: *mut c_char) -> c_int; + pub fn swapoff(puath: *const c_char) -> c_int; + pub fn swapon(path: *const c_char) -> c_int; pub fn sync(); pub fn telldir(dirp: *mut crate::DIR) -> c_long; pub fn timer_create( @@ -3328,7 +3328,7 @@ extern "C" { pub fn uname(buf: *mut crate::utsname) -> c_int; pub fn updwtmp(file: *const c_char, u: *const utmp); pub fn uselocale(loc: crate::locale_t) -> crate::locale_t; - pub fn utmpname(file: *mut c_char) -> c_int; + pub fn utmpname(file: *const c_char) -> c_int; pub fn utimensat( dirfd: c_int, path: *const c_char,