Skip to content

Link to std::io's platform-specific behavior disclaimer #95397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 28, 2022
Merged
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
8 changes: 6 additions & 2 deletions library/std/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ use crate::sys::os as os_imp;
///
/// # Platform-specific behavior
///
/// This function currently corresponds to the `getcwd` function on Unix
/// This function [currently] corresponds to the `getcwd` function on Unix
/// and the `GetCurrentDirectoryW` function on Windows.
///
/// [currently]: crate::io#platform-specific-behavior
///
/// # Errors
///
/// Returns an [`Err`] if the current working directory value is invalid.
Expand Down Expand Up @@ -56,11 +58,13 @@ pub fn current_dir() -> io::Result<PathBuf> {
///
/// # Platform-specific behavior
///
/// This function currently corresponds to the `chdir` function on Unix
/// This function [currently] corresponds to the `chdir` function on Unix
/// and the `SetCurrentDirectoryW` function on Windows.
///
/// Returns an [`Err`] if the operation fails.
///
/// [currently]: crate::io#platform-specific-behavior
///
/// # Examples
///
/// ```
Expand Down
9 changes: 7 additions & 2 deletions library/std/src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ pub use core::time::FromFloatSecsError;
/// ```
///
/// # Underlying System calls
/// Currently, the following system calls are being used to get the current time using `now()`:
///
/// The following system calls are [currently] being used by `now()` to find out
/// the current time:
///
/// | Platform | System call |
/// |-----------|----------------------------------------------------------------------|
Expand All @@ -113,6 +115,7 @@ pub use core::time::FromFloatSecsError;
/// | WASI | [__wasi_clock_time_get (Monotonic Clock)] |
/// | Windows | [QueryPerformanceCounter] |
///
/// [currently]: crate::io#platform-specific-behavior
/// [QueryPerformanceCounter]: https://docs.microsoft.com/en-us/windows/win32/api/profileapi/nf-profileapi-queryperformancecounter
/// [`insecure_time` usercall]: https://edp.fortanix.com/docs/api/fortanix_sgx_abi/struct.Usercalls.html#method.insecure_time
/// [timekeeping in SGX]: https://edp.fortanix.com/docs/concepts/rust-std/#codestdtimecode
Expand Down Expand Up @@ -203,7 +206,8 @@ pub struct Instant(time::Instant);
/// For example, on Windows the time is represented in 100 nanosecond intervals whereas Linux
/// can represent nanosecond intervals.
///
/// Currently, the following system calls are being used to get the current time using `now()`:
/// The following system calls are [currently] being used by `now()` to find out
/// the current time:
///
/// | Platform | System call |
/// |-----------|----------------------------------------------------------------------|
Expand All @@ -215,6 +219,7 @@ pub struct Instant(time::Instant);
/// | WASI | [__wasi_clock_time_get (Realtime Clock)] |
/// | Windows | [GetSystemTimePreciseAsFileTime] / [GetSystemTimeAsFileTime] |
///
/// [currently]: crate::io#platform-specific-behavior
/// [`insecure_time` usercall]: https://edp.fortanix.com/docs/api/fortanix_sgx_abi/struct.Usercalls.html#method.insecure_time
/// [timekeeping in SGX]: https://edp.fortanix.com/docs/concepts/rust-std/#codestdtimecode
/// [gettimeofday]: https://man7.org/linux/man-pages/man2/gettimeofday.2.html
Expand Down