From cf5fda66f91bbb272b2723abc5e936293378ca52 Mon Sep 17 00:00:00 2001 From: Bill Joy Date: Fri, 10 Oct 1980 08:45:10 -0800 Subject: [PATCH] date and time created 80/10/10 00:45:10 by bill SCCS-vsn: sbin/reboot/reboot.c 4.1 --- usr/src/sbin/reboot/reboot.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 usr/src/sbin/reboot/reboot.c diff --git a/usr/src/sbin/reboot/reboot.c b/usr/src/sbin/reboot/reboot.c new file mode 100644 index 0000000000..2e71c1cd62 --- /dev/null +++ b/usr/src/sbin/reboot/reboot.c @@ -0,0 +1,33 @@ +#include +#include +/* + * 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"); +} -- 2.20.1