Skip to content

Commit

Permalink
Feature gate reboot on non linux systems
Browse files Browse the repository at this point in the history
  • Loading branch information
morr0ne committed Sep 21, 2023
1 parent 98d6ea5 commit 30fee19
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ pub fn sethostname(name: &[u8]) -> io::Result<()> {
/// Reboot command to be used with [`reboot`]
///
/// [`reboot`]: crate::system::reboot
#[cfg(target_os = "linux")]
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
#[repr(i32)]
pub enum RebootCommand {
Expand Down Expand Up @@ -205,6 +206,7 @@ pub enum RebootCommand {
/// - [Linux]
///
/// [Linux]: https://man7.org/linux/man-pages/man2/reboot.2.html
#[cfg(target_os = "linux")]
pub fn reboot(cmd: RebootCommand) -> io::Result<()> {
backend::system::syscalls::reboot(cmd)
}

0 comments on commit 30fee19

Please sign in to comment.