|
|
1.1 root 1: #include <stdio.h>
2: #include <sys/reboot.h>
3: /*
4: * Reboot
5: */
6: static char *sccsid = "@(#)reboot.c 4.1 (Berkeley) 10/9/80";
7:
8: main(argc, argv)
9: int argc;
10: char **argv;
11: {
12: int howto;
13: register char *argp;
14:
15: argc--, argv++;
16: howto = 0;
17: while (argc > 0) {
18: if (!strcmp(*argv, "-s"))
19: howto |= RB_SINGLE;
20: else if (!strcmp(*argv, "-n"))
21: howto |= RB_NOSYNC;
22: else if (!strcmp(*argv, "-a"))
23: howto |= RB_ASKNAME;
24: else {
25: fprintf(stderr,
26: "usage: reboot [ -a ] [ -n ] [ -s ]\n");
27: exit(1);
28: }
29: argc--, argv++;
30: }
31: syscall(55, howto);
32: perror("reboot");
33: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.