1
/* $Id: syscall_reboot.c 61 2006-05-19 18:32:14Z steve-beattie $ */
4
* Copyright (C) 2002-2005 Novell/SUSE
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License as
8
* published by the Free Software Foundation, version 2 of the
15
#include <sys/types.h>
16
#include <sys/reboot.h>
19
int main(int argc, char *argv[])
21
int cmd = RB_ENABLE_CAD;
24
fprintf(stderr, "Usage %s [on|off|reboot]\n", argv[0]);
28
if (strcmp(argv[1], "off") == 0)
30
else if (strcmp(argv[1], "on") == 0)
31
/* dangerous, a CAD will do a forced reboot (no shutdown) */
33
else if (strcmp(argv[1], "reboot") == 0)
34
/* Aiieee, you could lose data if you do this */
37
fprintf(stderr, "Usage %s [on|off|reboot]\n", argv[0]);
41
if (reboot(cmd) == -1){
42
fprintf(stderr, "FAIL: reboot failed - %s\n",