summaryrefslogtreecommitdiff
path: root/src/os/freebsd-os_reboot.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2021-04-20 00:36:22 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2021-04-20 00:36:22 +0000
commit7286b1641527a9a124425acf33ae3f67354029f1 (patch)
tree8e1b970b67bdc81e1745f291d43d5f298c51a4ab /src/os/freebsd-os_reboot.c
parent1172c1e817d26d5f9bb0ec289dd9a71aadf2759c (diff)
downloads6-linux-init-7286b1641527a9a124425acf33ae3f67354029f1.tar.xz
Add base FreeBSD implementation
Diffstat (limited to 'src/os/freebsd-os_reboot.c')
-rw-r--r--src/os/freebsd-os_reboot.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/os/freebsd-os_reboot.c b/src/os/freebsd-os_reboot.c
new file mode 100644
index 0000000..159fd97
--- /dev/null
+++ b/src/os/freebsd-os_reboot.c
@@ -0,0 +1,11 @@
+/* ISC license. */
+
+#include <unistd.h>
+#include <sys/reboot.h>
+
+#include "os.h"
+
+void os_reboot (int what)
+{
+ reboot(what == 3 ? RB_AUTOBOOT : what == 2 ? RB_POWEROFF : RB_HALT) ;
+}