Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ targets = [
]

[dependencies]
libc = { version = "=0.2.175", features = ["extra_traits"] }
libc = { version = "=0.2.178", features = ["extra_traits"] }
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change of tv_nsec to 32-bit comes from libc 0.2.178, which we're using on AIX currently. However, I'm uncertain if this update is appropriate at this time for all targets.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is always fine to bump libc to a newer compatible version

bitflags = "2.3.3"
cfg-if = "1.0"
pin-utils = { version = "0.1.0", optional = true }
Expand Down
1 change: 1 addition & 0 deletions changelog/2714.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Define `timespec_tv_nsec_t` as 32-bit on both 32- and 64-bit AIX to match the platform ABI.
5 changes: 4 additions & 1 deletion src/sys/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<timespec> for TimeSpec {
Expand Down
Loading