date and time created 80/10/10 00:45:10 by bill
authorBill Joy <bill@ucbvax.Berkeley.EDU>
Fri, 10 Oct 1980 16:45:10 +0000 (08:45 -0800)
committerBill Joy <bill@ucbvax.Berkeley.EDU>
Fri, 10 Oct 1980 16:45:10 +0000 (08:45 -0800)
SCCS-vsn: sbin/reboot/reboot.c 4.1

usr/src/sbin/reboot/reboot.c [new file with mode: 0644]

diff --git a/usr/src/sbin/reboot/reboot.c b/usr/src/sbin/reboot/reboot.c
new file mode 100644 (file)
index 0000000..2e71c1c
--- /dev/null
@@ -0,0 +1,33 @@
+#include <stdio.h>
+#include <sys/reboot.h>
+/*
+ * Reboot
+ */
+static char *sccsid = "@(#)reboot.c    4.1 (Berkeley) %G%";
+
+main(argc, argv)
+       int argc;
+       char **argv;
+{
+       int howto;
+       register char *argp;
+
+       argc--, argv++;
+       howto = 0;
+       while (argc > 0) {
+               if (!strcmp(*argv, "-s"))
+                       howto |= RB_SINGLE;
+               else if (!strcmp(*argv, "-n"))
+                       howto |= RB_NOSYNC;
+               else if (!strcmp(*argv, "-a"))
+                       howto |= RB_ASKNAME;
+               else {
+                       fprintf(stderr,
+                           "usage: reboot [ -a ] [ -n ] [ -s ]\n");
+                       exit(1);
+               }
+               argc--, argv++;
+       }
+       syscall(55, howto);
+       perror("reboot");
+}