Bell 32V development
authorTom London <tbl@research.uucp>
Tue, 5 Dec 1978 11:03:04 +0000 (06:03 -0500)
committerTom London <tbl@research.uucp>
Tue, 5 Dec 1978 11:03:04 +0000 (06:03 -0500)
Work on file usr/src/cmd/nice.c

Co-Authored-By: John Reiser <jfr@research.uucp>
Synthesized-from: 32v

usr/src/cmd/nice.c [new file with mode: 0644]

diff --git a/usr/src/cmd/nice.c b/usr/src/cmd/nice.c
new file mode 100644 (file)
index 0000000..ed22a93
--- /dev/null
@@ -0,0 +1,26 @@
+/* nice */
+
+#include <stdio.h>
+
+main(argc, argv)
+int argc;
+char *argv[];
+{
+       int nicarg = 10;
+       extern errno;
+       extern char *sys_errlist[];
+
+       if(argc > 1 && argv[1][0] == '-') {
+               nicarg = atoi(&argv[1][1]);
+               argc--;
+               argv++;
+       }
+       if(argc < 2) {
+               fputs("usage: nice [ -n ] command\n", stderr);
+               exit(1);
+       }
+       nice(nicarg);
+       execvp(argv[1], &argv[1]);
+       fprintf(stderr, "%s: %s\n", sys_errlist[errno], argv[1]);
+       exit(1);
+}