From 30fee19d22ddd296104b8491330849c8ec74a0b1 Mon Sep 17 00:00:00 2001 From: Federico Maria Morrone Date: Thu, 21 Sep 2023 10:37:42 +0200 Subject: [PATCH] Feature gate reboot on non linux systems --- src/system.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/system.rs b/src/system.rs index b0bd45f16..801695945 100644 --- a/src/system.rs +++ b/src/system.rs @@ -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 { @@ -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) }