From 8f52030d475f10a6c184c87e7ace06f265fa6bc6 Mon Sep 17 00:00:00 2001 From: Amy Kwan Date: Fri, 12 Dec 2025 13:46:29 -0500 Subject: [PATCH 1/2] [AIX] Define timespec_tv_nsec_t as 32-bit. --- Cargo.toml | 2 +- src/sys/time.rs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index bcca102820..17becc2f3b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ targets = [ ] [dependencies] -libc = { version = "=0.2.175", features = ["extra_traits"] } +libc = { version = "=0.2.178", features = ["extra_traits"] } bitflags = "2.3.3" cfg-if = "1.0" pin-utils = { version = "0.1.0", optional = true } diff --git a/src/sys/time.rs b/src/sys/time.rs index 7e89c72149..11b86efb23 100644 --- a/src/sys/time.rs +++ b/src/sys/time.rs @@ -199,11 +199,14 @@ const TS_MAX_SECONDS: i64 = isize::MAX as i64; const TS_MIN_SECONDS: i64 = -TS_MAX_SECONDS; +// AIX: libc::timespec.tv_nsec is 32-bit c_int on both 32- and 64-bit. +#[cfg(target_os = "aix")] +type timespec_tv_nsec_t = libc::c_int; // x32 compatibility // See https://sourceware.org/bugzilla/show_bug.cgi?id=16437 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] type timespec_tv_nsec_t = i64; -#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] +#[cfg(not(any(target_os = "aix", all(target_arch = "x86_64", target_pointer_width = "32"))))] type timespec_tv_nsec_t = libc::c_long; impl From for TimeSpec { From 5abf0470bb31032dda648642f894aaf588079713 Mon Sep 17 00:00:00 2001 From: Amy Kwan Date: Sat, 13 Dec 2025 09:43:42 -0500 Subject: [PATCH 2/2] Add changelog. --- changelog/2714.fixed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/2714.fixed.md diff --git a/changelog/2714.fixed.md b/changelog/2714.fixed.md new file mode 100644 index 0000000000..6ff6146dc1 --- /dev/null +++ b/changelog/2714.fixed.md @@ -0,0 +1 @@ +Define `timespec_tv_nsec_t` as 32-bit on both 32- and 64-bit AIX to match the platform ABI.