diff --git a/Makefile b/Makefile index 30dce01..1322fb4 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,7 @@ SRC += \ insmod.c \ lsmod.c \ mkswap.c \ + reboot.c \ rmmod.c endif diff --git a/reboot.c b/reboot.c new file mode 100644 index 0000000..3a15f09 --- /dev/null +++ b/reboot.c @@ -0,0 +1,31 @@ +/* See LICENSE file for copyright and license details. */ +#include +#include +#include +#include +#include "util.h" + +static void +usage(void) +{ + eprintf("usage: %s\n", argv0); +} + +int +main(int argc, char *argv[]) +{ + ARGBEGIN { + default: + usage(); + } ARGEND; + + if (argc > 0) + usage(); + + sync(); + + if (syscall(__NR_reboot, 0xfee1dead, 672274793, + LINUX_REBOOT_CMD_RESTART, NULL) < 0) + eprintf("reboot:"); + return 0; +}