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

1.1     ! root        1: main(argc, argv)
        !             2: char **argv;
        !             3: {
        !             4:        int c, n;
        !             5:        char *s;
        !             6: 
        !             7:        n = 0;
        !             8:        if(argc < 2) {
        !             9:                printf("arg count\n");
        !            10:                exit(0);
        !            11:        }
        !            12:        s = argv[1];
        !            13:        while(c = *s++) {
        !            14:                if(c<'0' || c>'9') {
        !            15:                        printf("bad character\n");
        !            16:                        exit(0);
        !            17:                }
        !            18:                n = n*10 + c - '0';
        !            19:        }
        !            20:        sleep(n);
        !            21: }

unix.superglobalmegacorp.com

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