Skip to content

Commit 4f66783

Browse files
committed
Make timespec capping public to crate::sys
It is used in: - `library/std/src/sys/locks/condvar/pthread.rs` - `library/std/src/sys/pal/unix/thread_parking/pthread.rs`
1 parent dda102c commit 4f66783

File tree

1 file changed

+2
-2
lines changed
  • library/std/src/sys/pal/unix

1 file changed

+2
-2
lines changed

Diff for: library/std/src/sys/pal/unix/time.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub const TIMESPEC_MAX: libc::timespec =
1010
// This additional constant is only used when calling
1111
// `libc::pthread_cond_timedwait`.
1212
#[cfg(target_os = "nto")]
13-
pub(super) const TIMESPEC_MAX_CAPPED: libc::timespec = libc::timespec {
13+
pub(in crate::sys) const TIMESPEC_MAX_CAPPED: libc::timespec = libc::timespec {
1414
tv_sec: (u64::MAX / NSEC_PER_SEC) as i64,
1515
tv_nsec: (u64::MAX % NSEC_PER_SEC) as i64,
1616
};
@@ -204,7 +204,7 @@ impl Timespec {
204204
// On QNX Neutrino, the maximum timespec for e.g. pthread_cond_timedwait
205205
// is 2^64 nanoseconds
206206
#[cfg(target_os = "nto")]
207-
pub(super) fn to_timespec_capped(&self) -> Option<libc::timespec> {
207+
pub(in crate::sys) fn to_timespec_capped(&self) -> Option<libc::timespec> {
208208
// Check if timeout in nanoseconds would fit into an u64
209209
if (self.tv_nsec.0 as u64)
210210
.checked_add((self.tv_sec as u64).checked_mul(NSEC_PER_SEC)?)

0 commit comments

Comments
 (0)