mlibc/options/linux/generic/sys-reboot.cpp
2020-04-08 23:09:06 +02:00

18 lines
293 B
C++

#include <errno.h>
#include <sys/reboot.h>
#include <bits/ensure.h>
#include <mlibc/sysdeps.hpp>
int reboot(int what) {
if (!mlibc::sys_reboot) {
MLIBC_MISSING_SYSDEP();
errno = ENOSYS;
return -1;
}
if (int e = mlibc::sys_reboot(what); e) {
errno = e;
return -1;
}
return 0;
}