Annotation of researchv9/cmd/reboot.c, revision 1.1

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 how;
        !            13:        register char *argp;
        !            14: 
        !            15:        argc--, argv++;
        !            16:        how = 0;
        !            17:        while (argc > 0) {
        !            18:                if (!strcmp(*argv, "-s"))
        !            19:                        how |= RB_SINGLE;
        !            20:                else if (!strcmp(*argv, "-n"))
        !            21:                        how |= RB_NOSYNC;
        !            22:                else if (!strcmp(*argv, "-a"))
        !            23:                        how |= RB_ASKNAME;
        !            24:                else if (!strcmp(*argv, "-d"))
        !            25:                        how |= RB_PANIC;
        !            26:                else {
        !            27:                        fprintf(stderr,
        !            28:                            "usage: reboot [ -a ] [ -n ] [ -s ] [ -d ]\n");
        !            29:                        exit(1);
        !            30:                }
        !            31:                argc--, argv++;
        !            32:        }
        !            33:        reboot(how);
        !            34:        perror("reboot");
        !            35: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.