about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-02-23 17:02:05 +0100
committerGitHub <noreply@github.com>2024-02-23 17:02:05 +0100
commit2e8177a208eddd2eeb8819fa73e063073a7e370e (patch)
tree6817075a399b0a3d64e322c9824467b842e78227
parent15b77953d7b181de366102d55b1855ccfab2302a (diff)
parent4f66783240bf0f740b616c073aa444436e9f22c7 (diff)
downloadrust-2e8177a208eddd2eeb8819fa73e063073a7e370e.tar.gz
rust-2e8177a208eddd2eeb8819fa73e063073a7e370e.zip
Rollup merge of #121498 - flba-eb:make_timespec_capping_public, r=Nilstrieb
Make QNX/NTO specific "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`

This is probably required due to introduction of `sys/pal` and #121177

`@rustbot` label +O-neutrino
CC: `@jonathanpallant` `@japaric` `@gh-tr`
-rw-r--r--library/std/src/sys/pal/unix/time.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/std/src/sys/pal/unix/time.rs b/library/std/src/sys/pal/unix/time.rs
index f62eb828ee5..251a37d54dd 100644
--- a/library/std/src/sys/pal/unix/time.rs
+++ b/library/std/src/sys/pal/unix/time.rs
@@ -10,7 +10,7 @@ pub const TIMESPEC_MAX: libc::timespec =
 // This additional constant is only used when calling
 // `libc::pthread_cond_timedwait`.
 #[cfg(target_os = "nto")]
-pub(super) const TIMESPEC_MAX_CAPPED: libc::timespec = libc::timespec {
+pub(in crate::sys) const TIMESPEC_MAX_CAPPED: libc::timespec = libc::timespec {
     tv_sec: (u64::MAX / NSEC_PER_SEC) as i64,
     tv_nsec: (u64::MAX % NSEC_PER_SEC) as i64,
 };
@@ -204,7 +204,7 @@ impl Timespec {
     // On QNX Neutrino, the maximum timespec for e.g. pthread_cond_timedwait
     // is 2^64 nanoseconds
     #[cfg(target_os = "nto")]
-    pub(super) fn to_timespec_capped(&self) -> Option<libc::timespec> {
+    pub(in crate::sys) fn to_timespec_capped(&self) -> Option<libc::timespec> {
         // Check if timeout in nanoseconds would fit into an u64
         if (self.tv_nsec.0 as u64)
             .checked_add((self.tv_sec as u64).checked_mul(NSEC_PER_SEC)?)