Skip to content

Commit 44c3b6d

Browse files
committed
Fix Linux build on 32-bit platforms
1 parent 2f54117 commit 44c3b6d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "wait_on_address"
33
description = "Cross-platform atomic wait and wake (aka futex) functionality."
44
repository = "https://github.com/DouglasDwyer/wait_on_address"
55
keywords = ["atomic", "futex"]
6-
version = "0.1.3"
6+
version = "0.1.4"
77
edition = "2024"
88
license = "BSD-2-Clause"
99
categories = ["concurrency", "os", "no-std"]

src/linux.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use libc::{c_long, time_t};
12
use std::{
23
sync::atomic::{AtomicU32, AtomicU64, Ordering},
34
time::Duration,
@@ -11,8 +12,8 @@ impl AtomicWaitImpl for AtomicU32 {
1112
fn wait_timeout(&self, value: Self::AtomicInner, timeout: Option<Duration>) {
1213
unsafe {
1314
let wait_timespec = timeout.map(|x| libc::timespec {
14-
tv_sec: x.as_secs() as i64,
15-
tv_nsec: x.subsec_nanos() as i64,
15+
tv_sec: x.as_secs() as time_t,
16+
tv_nsec: x.subsec_nanos() as c_long,
1617
});
1718

1819
libc::syscall(

0 commit comments

Comments
 (0)