Skip to content

Commit d3ff266

Browse files
committed
Document reboot.rs
1 parent 7c9a7af commit d3ff266

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/sys/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ feature! {
9191
#[cfg(target_os = "linux")]
9292
feature! {
9393
#![feature = "reboot"]
94-
#[allow(missing_docs)]
9594
pub mod reboot;
9695
}
9796

src/sys/reboot.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,22 @@ libc_enum! {
1313
#[repr(i32)]
1414
#[non_exhaustive]
1515
pub enum RebootMode {
16+
/// Halt the system.
1617
RB_HALT_SYSTEM,
18+
/// Execute a kernel that has been loaded earlier with
19+
/// [`kexec_load(2)`](https://man7.org/linux/man-pages/man2/kexec_load.2.html).
1720
RB_KEXEC,
21+
/// Stop the system and switch off power, if possible.
1822
RB_POWER_OFF,
23+
/// Restart the system.
1924
RB_AUTOBOOT,
20-
// we do not support Restart2,
25+
// we do not support Restart2.
26+
/// Suspend the system using software suspend.
2127
RB_SW_SUSPEND,
2228
}
2329
}
2430

31+
/// Reboots or shuts down the system.
2532
pub fn reboot(how: RebootMode) -> Result<Infallible> {
2633
unsafe {
2734
libc::reboot(how as libc::c_int)

0 commit comments

Comments
 (0)