Skip to content

Commit b28c5a8

Browse files
authored
Miscellaneous documentation cleanups. (#929)
1 parent cc82ed2 commit b28c5a8

File tree

8 files changed

+41
-7
lines changed

8 files changed

+41
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ version of this crate.
158158
[`simple_libc`]: https://crates.io/crates/simple_libc
159159
[`uapi`]: https://crates.io/crates/uapi
160160
[`rusl`]: https://lib.rs/crates/rusl
161-
[`relibc`]: https://github.com/redox-os/relibc
161+
[`relibc`]: https://gitlab.redox-os.org/redox-os/relibc
162162
[`syscall`]: https://crates.io/crates/syscall
163163
[`sc`]: https://crates.io/crates/sc
164164
[`scall`]: https://crates.io/crates/scall

src/backend/libc/mount/types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,9 @@ bitflags! {
299299

300300
#[cfg(linux_kernel)]
301301
bitflags! {
302-
/// `MS_*` constants for use with [`change_mount`].
302+
/// `MS_*` constants for use with [`mount_change`].
303303
///
304-
/// [`change_mount`]: crate::mount::change_mount
304+
/// [`mount_change`]: crate::mount::mount_change
305305
#[repr(transparent)]
306306
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
307307
pub struct MountPropagationFlags: c::c_ulong {

src/backend/libc/time/types.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,11 @@ bitflags! {
8383
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
8484
pub struct TimerfdFlags: u32 {
8585
/// `TFD_NONBLOCK`
86+
#[doc(alias = "TFD_NONBLOCK")]
8687
const NONBLOCK = bitcast!(c::TFD_NONBLOCK);
8788

8889
/// `TFD_CLOEXEC`
90+
#[doc(alias = "TFD_CLOEXEC")]
8991
const CLOEXEC = bitcast!(c::TFD_CLOEXEC);
9092

9193
/// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
@@ -102,10 +104,12 @@ bitflags! {
102104
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
103105
pub struct TimerfdTimerFlags: u32 {
104106
/// `TFD_TIMER_ABSTIME`
107+
#[doc(alias = "TFD_TIMER_ABSTIME")]
105108
const ABSTIME = bitcast!(c::TFD_TIMER_ABSTIME);
106109

107110
/// `TFD_TIMER_CANCEL_ON_SET`
108111
#[cfg(linux_kernel)]
112+
#[doc(alias = "TFD_TIMER_CANCEL_ON_SET")]
109113
const CANCEL_ON_SET = bitcast!(c::TFD_TIMER_CANCEL_ON_SET);
110114

111115
/// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
@@ -127,6 +131,7 @@ pub enum TimerfdClockId {
127131
/// epoch, 1970-01-01T00:00:00Z. The clock is externally settable, so it is
128132
/// not monotonic. Successive reads may see decreasing times, so it isn't
129133
/// reliable for measuring durations.
134+
#[doc(alias = "CLOCK_REALTIME")]
130135
Realtime = bitcast!(c::CLOCK_REALTIME),
131136

132137
/// `CLOCK_MONOTONIC`—A clock that tells an abstract time.
@@ -137,26 +142,30 @@ pub enum TimerfdClockId {
137142
///
138143
/// This clock does not advance while the system is suspended; see
139144
/// `Boottime` for a clock that does.
145+
#[doc(alias = "CLOCK_MONOTONIC")]
140146
Monotonic = bitcast!(c::CLOCK_MONOTONIC),
141147

142148
/// `CLOCK_BOOTTIME`—Like `Monotonic`, but advances while suspended.
143149
///
144150
/// This clock is similar to `Monotonic`, but does advance while the system
145151
/// is suspended.
152+
#[doc(alias = "CLOCK_BOOTTIME")]
146153
Boottime = bitcast!(c::CLOCK_BOOTTIME),
147154

148155
/// `CLOCK_REALTIME_ALARM`—Like `Realtime`, but wakes a suspended system.
149156
///
150157
/// This clock is like `Realtime`, but can wake up a suspended system.
151158
///
152159
/// Use of this clock requires the `CAP_WAKE_ALARM` Linux capability.
160+
#[doc(alias = "CLOCK_REALTIME_ALARM")]
153161
RealtimeAlarm = bitcast!(c::CLOCK_REALTIME_ALARM),
154162

155163
/// `CLOCK_BOOTTIME_ALARM`—Like `Boottime`, but wakes a suspended system.
156164
///
157165
/// This clock is like `Boottime`, but can wake up a suspended system.
158166
///
159167
/// Use of this clock requires the `CAP_WAKE_ALARM` Linux capability.
168+
#[doc(alias = "CLOCK_BOOTTIME_ALARM")]
160169
BoottimeAlarm = bitcast!(c::CLOCK_BOOTTIME_ALARM),
161170
}
162171

src/backend/linux_raw/mount/types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,9 @@ bitflags! {
292292
}
293293

294294
bitflags! {
295-
/// `MS_*` constants for use with [`change_mount`].
295+
/// `MS_*` constants for use with [`mount_change`].
296296
///
297-
/// [`change_mount`]: crate::mount::change_mount
297+
/// [`mount_change`]: crate::mount::mount_change
298298
#[repr(transparent)]
299299
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
300300
pub struct MountPropagationFlags: c::c_uint {

src/backend/linux_raw/runtime/syscalls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,6 @@ pub(crate) fn exit_group(code: c::c_int) -> ! {
300300

301301
#[inline]
302302
pub(crate) unsafe fn brk(addr: *mut c::c_void) -> io::Result<*mut c_void> {
303-
// Don't mark this `readonly`, so that loads don't get reordered past it.
303+
// This is non-`readonly`, to prevent loads from being reordered past it.
304304
ret_void_star(syscall!(__NR_brk, addr))
305305
}

src/backend/linux_raw/time/types.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ bitflags! {
1616
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
1717
pub struct TimerfdFlags: c::c_uint {
1818
/// `TFD_NONBLOCK`
19+
#[doc(alias = "TFD_NONBLOCK")]
1920
const NONBLOCK = linux_raw_sys::general::TFD_NONBLOCK;
2021

2122
/// `TFD_CLOEXEC`
23+
#[doc(alias = "TFD_CLOEXEC")]
2224
const CLOEXEC = linux_raw_sys::general::TFD_CLOEXEC;
2325

2426
/// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
@@ -34,9 +36,11 @@ bitflags! {
3436
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
3537
pub struct TimerfdTimerFlags: c::c_uint {
3638
/// `TFD_TIMER_ABSTIME`
39+
#[doc(alias = "TFD_TIMER_ABSTIME")]
3740
const ABSTIME = linux_raw_sys::general::TFD_TIMER_ABSTIME;
3841

3942
/// `TFD_TIMER_CANCEL_ON_SET`
43+
#[doc(alias = "TFD_TIMER_CANCEL_ON_SET")]
4044
const CANCEL_ON_SET = linux_raw_sys::general::TFD_TIMER_CANCEL_ON_SET;
4145

4246
/// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
@@ -57,6 +61,7 @@ pub enum TimerfdClockId {
5761
/// epoch, 1970-01-01T00:00:00Z. The clock is externally settable, so it is
5862
/// not monotonic. Successive reads may see decreasing times, so it isn't
5963
/// reliable for measuring durations.
64+
#[doc(alias = "CLOCK_REALTIME")]
6065
Realtime = linux_raw_sys::general::CLOCK_REALTIME,
6166

6267
/// `CLOCK_MONOTONIC`—A clock that tells an abstract time.
@@ -67,25 +72,29 @@ pub enum TimerfdClockId {
6772
///
6873
/// This clock does not advance while the system is suspended; see
6974
/// `Boottime` for a clock that does.
75+
#[doc(alias = "CLOCK_MONOTONIC")]
7076
Monotonic = linux_raw_sys::general::CLOCK_MONOTONIC,
7177

7278
/// `CLOCK_BOOTTIME`—Like `Monotonic`, but advances while suspended.
7379
///
7480
/// This clock is similar to `Monotonic`, but does advance while the system
7581
/// is suspended.
82+
#[doc(alias = "CLOCK_BOOTTIME")]
7683
Boottime = linux_raw_sys::general::CLOCK_BOOTTIME,
7784

7885
/// `CLOCK_REALTIME_ALARM`—Like `Realtime`, but wakes a suspended system.
7986
///
8087
/// This clock is like `Realtime`, but can wake up a suspended system.
8188
///
8289
/// Use of this clock requires the `CAP_WAKE_ALARM` Linux capability.
90+
#[doc(alias = "CLOCK_REALTIME_ALARM")]
8391
RealtimeAlarm = linux_raw_sys::general::CLOCK_REALTIME_ALARM,
8492

8593
/// `CLOCK_BOOTTIME_ALARM`—Like `Boottime`, but wakes a suspended system.
8694
///
8795
/// This clock is like `Boottime`, but can wake up a suspended system.
8896
///
8997
/// Use of this clock requires the `CAP_WAKE_ALARM` Linux capability.
98+
#[doc(alias = "CLOCK_BOOTTIME_ALARM")]
9099
BoottimeAlarm = linux_raw_sys::general::CLOCK_BOOTTIME_ALARM,
91100
}

src/clockid.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@ use crate::fd::BorrowedFd;
1717
#[non_exhaustive]
1818
pub enum ClockId {
1919
/// `CLOCK_REALTIME`
20+
#[doc(alias = "CLOCK_REALTIME")]
2021
Realtime = bitcast!(c::CLOCK_REALTIME),
2122

2223
/// `CLOCK_MONOTONIC`
24+
#[doc(alias = "CLOCK_MONOTONIC")]
2325
Monotonic = bitcast!(c::CLOCK_MONOTONIC),
2426

2527
/// `CLOCK_UPTIME`
2628
#[cfg(any(freebsdlike, target_os = "openbsd"))]
29+
#[doc(alias = "CLOCK_UPTIME")]
2730
Uptime = c::CLOCK_UPTIME,
2831

2932
/// `CLOCK_PROCESS_CPUTIME_ID`
@@ -33,6 +36,7 @@ pub enum ClockId {
3336
target_os = "redox",
3437
target_os = "vita"
3538
)))]
39+
#[doc(alias = "CLOCK_PROCESS_CPUTIME_ID")]
3640
ProcessCPUTime = c::CLOCK_PROCESS_CPUTIME_ID,
3741

3842
/// `CLOCK_THREAD_CPUTIME_ID`
@@ -42,18 +46,22 @@ pub enum ClockId {
4246
target_os = "redox",
4347
target_os = "vita"
4448
)))]
49+
#[doc(alias = "CLOCK_THREAD_CPUTIME_ID")]
4550
ThreadCPUTime = c::CLOCK_THREAD_CPUTIME_ID,
4651

4752
/// `CLOCK_REALTIME_COARSE`
4853
#[cfg(any(linux_kernel, target_os = "freebsd"))]
54+
#[doc(alias = "CLOCK_REALTIME_COARSE")]
4955
RealtimeCoarse = c::CLOCK_REALTIME_COARSE,
5056

5157
/// `CLOCK_MONOTONIC_COARSE`
5258
#[cfg(any(linux_kernel, target_os = "freebsd"))]
59+
#[doc(alias = "CLOCK_MONOTONIC_COARSE")]
5360
MonotonicCoarse = c::CLOCK_MONOTONIC_COARSE,
5461

5562
/// `CLOCK_MONOTONIC_RAW`
5663
#[cfg(linux_kernel)]
64+
#[doc(alias = "CLOCK_MONOTONIC_RAW")]
5765
MonotonicRaw = c::CLOCK_MONOTONIC_RAW,
5866

5967
/// `CLOCK_REALTIME_ALARM`, available on Linux >= 3.0
@@ -98,15 +106,19 @@ pub enum ClockId {
98106
#[non_exhaustive]
99107
pub enum ClockId {
100108
/// `CLOCK_REALTIME`
109+
#[doc(alias = "CLOCK_REALTIME")]
101110
Realtime = c::CLOCK_REALTIME,
102111

103112
/// `CLOCK_MONOTONIC`
113+
#[doc(alias = "CLOCK_MONOTONIC")]
104114
Monotonic = c::CLOCK_MONOTONIC,
105115

106116
/// `CLOCK_PROCESS_CPUTIME_ID`
117+
#[doc(alias = "CLOCK_PROCESS_CPUTIME_ID")]
107118
ProcessCPUTime = c::CLOCK_PROCESS_CPUTIME_ID,
108119

109120
/// `CLOCK_THREAD_CPUTIME_ID`
121+
#[doc(alias = "CLOCK_THREAD_CPUTIME_ID")]
110122
ThreadCPUTime = c::CLOCK_THREAD_CPUTIME_ID,
111123
}
112124

@@ -129,10 +141,12 @@ pub enum DynamicClockId<'a> {
129141

130142
/// `CLOCK_REALTIME_ALARM`, available on Linux >= 3.0
131143
#[cfg(linux_kernel)]
144+
#[doc(alias = "CLOCK_REALTIME_ALARM")]
132145
RealtimeAlarm,
133146

134147
/// `CLOCK_TAI`, available on Linux >= 3.10
135148
#[cfg(linux_kernel)]
149+
#[doc(alias = "CLOCK_TAI")]
136150
Tai,
137151

138152
/// `CLOCK_BOOTTIME`, available on Linux >= 2.6.39
@@ -142,9 +156,11 @@ pub enum DynamicClockId<'a> {
142156
target_os = "fuchsia",
143157
target_os = "openbsd"
144158
))]
159+
#[doc(alias = "CLOCK_BOOTTIME")]
145160
Boottime,
146161

147162
/// `CLOCK_BOOTTIME_ALARM`, available on Linux >= 2.6.39
148163
#[cfg(any(linux_kernel, target_os = "fuchsia"))]
164+
#[doc(alias = "CLOCK_BOOTTIME_ALARM")]
149165
BoottimeAlarm,
150166
}

src/ioctl/bsd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! `ioctl` opcode behavior for Linux platforms.
1+
//! `ioctl` opcode behavior for BSD platforms.
22
33
use super::{Direction, RawOpcode};
44

0 commit comments

Comments
 (0)