Annotation of 42BSD/bin/nice.c, revision 1.1

1.1     ! root        1: #ifndef lint
        !             2: static char *sccsid = "@(#)nice.c      4.2 (Berkeley) 5/22/83";
        !             3: #endif
        !             4: 
        !             5: #include <stdio.h>
        !             6: 
        !             7: #include <sys/time.h>
        !             8: #include <sys/resource.h>
        !             9: 
        !            10: main(argc, argv)
        !            11:        int argc;
        !            12:        char *argv[];
        !            13: {
        !            14:        int nicarg = 10;
        !            15: 
        !            16:        if (argc > 1 && argv[1][0] == '-') {
        !            17:                nicarg = atoi(&argv[1][1]);
        !            18:                argc--, argv++;
        !            19:        }
        !            20:        if (argc < 2) {
        !            21:                fputs("usage: nice [ -n ] command\n", stderr);
        !            22:                exit(1);
        !            23:        }
        !            24:        if (setpriority(PRIO_PROCESS, 0, nicarg) < 0) {
        !            25:                perror("setpriority");
        !            26:                exit(1);
        !            27:        }
        !            28:        execvp(argv[1], &argv[1]);
        !            29:        perror(argv[1]);
        !            30:        exit(1);
        !            31: }

unix.superglobalmegacorp.com

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