cleanups, add manual page
[unix-history] / usr / src / usr.bin / renice / renice.c
index b82ff88..f624cf5 100644 (file)
@@ -1,6 +1,18 @@
+/*
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ */
+
+#ifndef lint
+char copyright[] =
+"@(#) Copyright (c) 1980 Regents of the University of California.\n\
+ All rights reserved.\n";
+#endif not lint
+
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)renice.c    4.5 (Berkeley) 83/07/24";
-#endif
+static char sccsid[] = "@(#)renice.c   5.1 (Berkeley) %G%";
+#endif not lint
 
 #include <sys/time.h>
 #include <sys/resource.h>
 
 #include <sys/time.h>
 #include <sys/resource.h>
@@ -19,8 +31,9 @@ main(argc, argv)
        int who = 0, prio, errs = 0;
 
        argc--, argv++;
        int who = 0, prio, errs = 0;
 
        argc--, argv++;
-       if (argc < 1) {
-               fprintf(stderr, "usage: renice priority [ who ... ]\n");
+       if (argc < 2) {
+               fprintf(stderr, "usage: renice priority [ [ -p ] pids ] ");
+               fprintf(stderr, "[ [ -g ] pgrps ] [ [ -u ] users ]\n");
                exit(1);
        }
        prio = atoi(*argv);
                exit(1);
        }
        prio = atoi(*argv);
@@ -29,8 +42,6 @@ main(argc, argv)
                prio = PRIO_MAX;
        if (prio < PRIO_MIN)
                prio = PRIO_MIN;
                prio = PRIO_MAX;
        if (prio < PRIO_MIN)
                prio = PRIO_MIN;
-       if (argc == 0)
-               exit(donice(which, 0, prio));
        for (; argc > 0; argc--, argv++) {
                if (strcmp(*argv, "-g") == 0) {
                        which = PRIO_PGRP;
        for (; argc > 0; argc--, argv++) {
                if (strcmp(*argv, "-g") == 0) {
                        which = PRIO_PGRP;