summaryrefslogtreecommitdiff
path: root/src/os/linux-os_reboot.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2021-04-20 00:00:22 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2021-04-20 00:00:22 +0000
commit1172c1e817d26d5f9bb0ec289dd9a71aadf2759c (patch)
tree6c7e5eb2ebb255c7be81d1535559fa7c4a63af4b /src/os/linux-os_reboot.c
parent3bde455795bb3273922ec7be293e3911913576c2 (diff)
downloads6-linux-init-1172c1e817d26d5f9bb0ec289dd9a71aadf2759c.tar.xz
Add portability infrastructure
Diffstat (limited to 'src/os/linux-os_reboot.c')
-rw-r--r--src/os/linux-os_reboot.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/os/linux-os_reboot.c b/src/os/linux-os_reboot.c
new file mode 100644
index 0000000..fb41584
--- /dev/null
+++ b/src/os/linux-os_reboot.c
@@ -0,0 +1,10 @@
+/* ISC license. */
+
+#include <sys/reboot.h>
+
+#include "os.h"
+
+void os_reboot (int what)
+{
+ reboot(what == 3 ? RB_AUTOBOOT : what == 2 ? RB_POWER_OFF : RB_HALT_SYSTEM) ;
+}