summaryrefslogtreecommitdiff
path: root/src/os/freebsd-os_reboot.c
diff options
context:
space:
mode:
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) ;
+}