Skip to content

Commit 080e0d2

Browse files
authored
Misc documentation cleanups. (#1120)
1 parent c636c2b commit 080e0d2

File tree

10 files changed

+30
-20
lines changed

10 files changed

+30
-20
lines changed

src/backend/libc/fs/syscalls.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2255,8 +2255,8 @@ pub(crate) fn getxattr(path: &CStr, name: &CStr, value: &mut [u8]) -> io::Result
22552255

22562256
#[cfg(apple)]
22572257
{
2258-
// Passing an empty to slice to getxattr leads to ERANGE on macOS. Pass null
2259-
// instead.
2258+
// Passing an empty to slice to getxattr leads to ERANGE on macOS. Pass
2259+
// null instead.
22602260
let ptr = if value.is_empty() {
22612261
core::ptr::null_mut()
22622262
} else {
@@ -2291,8 +2291,8 @@ pub(crate) fn lgetxattr(path: &CStr, name: &CStr, value: &mut [u8]) -> io::Resul
22912291

22922292
#[cfg(apple)]
22932293
{
2294-
// Passing an empty to slice to getxattr leads to ERANGE on macOS. Pass null
2295-
// instead.
2294+
// Passing an empty to slice to getxattr leads to ERANGE on macOS. Pass
2295+
// null instead.
22962296
let ptr = if value.is_empty() {
22972297
core::ptr::null_mut()
22982298
} else {
@@ -2328,8 +2328,8 @@ pub(crate) fn fgetxattr(fd: BorrowedFd<'_>, name: &CStr, value: &mut [u8]) -> io
23282328

23292329
#[cfg(apple)]
23302330
{
2331-
// Passing an empty to slice to getxattr leads to ERANGE on macOS. Pass null
2332-
// instead.
2331+
// Passing an empty to slice to getxattr leads to ERANGE on macOS. Pass
2332+
// null instead.
23332333
let ptr = if value.is_empty() {
23342334
core::ptr::null_mut()
23352335
} else {

src/backend/libc/pipe/types.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ bitflags! {
3737
bitflags! {
3838
/// `SPLICE_F_*` constants for use with [`splice`], [`vmsplice`], and
3939
/// [`tee`].
40+
///
41+
/// [`splice`]: crate::pipe::splice
42+
/// [`vmsplice`]: crate::pipe::splice
43+
/// [`tee`]: crate::pipe::tee
4044
#[repr(transparent)]
4145
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
4246
pub struct SpliceFlags: c::c_uint {

src/backend/libc/process/syscalls.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ pub(crate) fn prlimit(pid: Option<Pid>, limit: Resource, new: Rlimit) -> io::Res
380380
}
381381
}
382382

383-
/// Convert a Rust [`Rlimit`] to a C `c::rlimit`.
383+
/// Convert a C `c::rlimit` to a Rust `Rlimit`.
384384
#[cfg(not(any(
385385
target_os = "espidf",
386386
target_os = "fuchsia",
@@ -402,7 +402,7 @@ fn rlimit_from_libc(lim: c::rlimit) -> Rlimit {
402402
Rlimit { current, maximum }
403403
}
404404

405-
/// Convert a C `c::rlimit` to a Rust `Rlimit`.
405+
/// Convert a Rust [`Rlimit`] to a C `c::rlimit`.
406406
#[cfg(not(any(
407407
target_os = "espidf",
408408
target_os = "fuchsia",

src/backend/linux_raw/param/auxv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ pub(in super::super) fn sysinfo_ehdr() -> *const Elf_Ehdr {
145145
let mut ehdr = SYSINFO_EHDR.load(Relaxed);
146146

147147
if ehdr.is_null() {
148-
// Use `maybe_init_auxv` to to read the aux vectors if it can, but do
148+
// Use `maybe_init_auxv` to read the aux vectors if it can, but do
149149
// nothing if it can't. If it can't, then we'll get a null pointer
150150
// here, which our callers are prepared to deal with.
151151
maybe_init_auxv();

src/backend/linux_raw/pipe/types.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ bitflags! {
2424
bitflags! {
2525
/// `SPLICE_F_*` constants for use with [`splice`], [`vmsplice`], and
2626
/// [`tee`].
27+
///
28+
/// [`splice`]: crate::pipe::splice
29+
/// [`vmsplice`]: crate::pipe::splice
30+
/// [`tee`]: crate::pipe::tee
2731
#[repr(transparent)]
2832
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
2933
pub struct SpliceFlags: c::c_uint {

src/backend/linux_raw/process/syscalls.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ pub(crate) fn prlimit(pid: Option<Pid>, limit: Resource, new: Rlimit) -> io::Res
345345
}
346346
}
347347

348-
/// Convert a Rust [`Rlimit`] to a C `rlimit64`.
348+
/// Convert a C `rlimit64` to a Rust `Rlimit`.
349349
#[inline]
350350
fn rlimit_from_linux(lim: rlimit64) -> Rlimit {
351351
let current = if lim.rlim_cur == RLIM64_INFINITY as _ {
@@ -361,7 +361,7 @@ fn rlimit_from_linux(lim: rlimit64) -> Rlimit {
361361
Rlimit { current, maximum }
362362
}
363363

364-
/// Convert a C `rlimit64` to a Rust `Rlimit`.
364+
/// Convert a Rust [`Rlimit`] to a C `rlimit64`.
365365
#[inline]
366366
fn rlimit_to_linux(lim: Rlimit) -> rlimit64 {
367367
let rlim_cur = match lim.current {

src/fs/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ mod constants;
77
#[cfg(linux_kernel)]
88
mod copy_file_range;
99
#[cfg(not(any(target_os = "espidf", target_os = "redox")))]
10-
#[cfg(not(target_os = "haiku"))] // Haiku needs <https://github.com/rust-lang/rust/pull/112371>
10+
#[cfg(not(target_os = "haiku"))]
11+
// Haiku needs <https://git.haiku-os.org/haiku/commit/?id=b8caef69155fbe87def579305622b9718d7779dc>
1112
mod cwd;
1213
#[cfg(all(feature = "alloc", not(any(target_os = "espidf", target_os = "redox"))))]
1314
mod dir;
@@ -75,7 +76,8 @@ pub use constants::*;
7576
#[cfg(linux_kernel)]
7677
pub use copy_file_range::copy_file_range;
7778
#[cfg(not(any(target_os = "espidf", target_os = "redox")))]
78-
#[cfg(not(target_os = "haiku"))] // Haiku needs <https://github.com/rust-lang/rust/pull/112371>
79+
#[cfg(not(target_os = "haiku"))]
80+
// Haiku needs <https://git.haiku-os.org/haiku/commit/?id=b8caef69155fbe87def579305622b9718d7779dc>
7981
pub use cwd::*;
8082
#[cfg(all(feature = "alloc", not(any(target_os = "espidf", target_os = "redox"))))]
8183
pub use dir::{Dir, DirEntry};

src/process/sched.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ pub fn sched_getaffinity(pid: Option<Pid>) -> io::Result<CpuSet> {
151151
/// - [Linux]
152152
/// - [DragonFly BSD]
153153
///
154-
/// [Linux]: https://man7.org/linux/man-pages/man2/sched_getcpu.2.html
154+
/// [Linux]: https://man7.org/linux/man-pages/man3/sched_getcpu.3.html
155155
/// [DragonFly BSD]: https://man.dragonflybsd.org/?command=sched_getcpu&section=2
156156
// FreeBSD added `sched_getcpu` in 13.0.
157157
#[cfg(any(linux_kernel, target_os = "dragonfly"))]

src/runtime.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,8 @@ pub unsafe fn sigaltstack(new: Option<Stack>) -> io::Result<Stack> {
408408
/// # Safety
409409
///
410410
/// You're on your own. And on top of all the troubles with signal handlers,
411-
/// this implementation is highly experimental. The warning about the hazard
412-
/// of recycled thread ID's applies.
411+
/// this implementation is highly experimental. Also, this is not `tgkill`, so
412+
/// the warning about the hazard of recycled thread ID's applies.
413413
///
414414
/// # References
415415
/// - [Linux]
@@ -420,7 +420,7 @@ pub unsafe fn tkill(tid: Pid, sig: Signal) -> io::Result<()> {
420420
backend::runtime::syscalls::tkill(tid, sig)
421421
}
422422

423-
/// `sigprocmask(how, set, oldset)`—Adjust the process signal mask.
423+
/// `rt_sigprocmask(how, set, oldset)`—Adjust the process signal mask.
424424
///
425425
/// # Safety
426426
///
@@ -429,10 +429,10 @@ pub unsafe fn tkill(tid: Pid, sig: Signal) -> io::Result<()> {
429429
/// the libc `sigprocmask` in several non-obvious and unsafe ways.
430430
///
431431
/// # References
432-
/// - [Linux `sigprocmask`]
432+
/// - [Linux `rt_sigprocmask`]
433433
/// - [Linux `pthread_sigmask`]
434434
///
435-
/// [Linux `sigprocmask`]: https://man7.org/linux/man-pages/man2/sigprocmask.2.html
435+
/// [Linux `rt_sigprocmask`]: https://man7.org/linux/man-pages/man2/rt_sigprocmask.2.html
436436
/// [Linux `pthread_sigmask`]: https://man7.org/linux/man-pages/man3/pthread_sigmask.3.html
437437
#[inline]
438438
#[doc(alias = "pthread_sigmask")]

src/termios/tc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ pub fn tcsetpgrp<Fd: AsFd>(fd: Fd, pid: Pid) -> io::Result<()> {
8282

8383
/// `tcsetattr(fd)`—Set terminal attributes.
8484
///
85-
/// Also known as the `TCSETS` (or `TCSETS2 on Linux) operation with `ioctl`.
85+
/// Also known as the `TCSETS` (or `TCSETS2` on Linux) operation with `ioctl`.
8686
///
8787
/// # References
8888
/// - [POSIX `tcsetattr`]

0 commit comments

Comments
 (0)