1: #ifndef lint
2: static char sccs_id [] = "@(#)submit.c 1.9 5/5/81";
3: #endif
4: #include <ctype.h>
5: #include <signal.h>
6:
7: extern errno;
8:
9: main(ac, av)
10: register char **av;
11: {
12: register i, pid;
13:
14: signal (SIGINT, SIG_IGN);
15: signal (SIGQUIT, SIG_IGN);
16:
17: switch (fork ()) {
18:
19: case -1:
20: error (*av);
21:
22: case 0:
23: --ac, ++av;
24: if (!strcmp ("-p", *av) || isnumber(*av) ) {
25: if (**av == '-') { av++; ac--; }
26: while (ac--)
27: if (submit (pid = atoi (*av++)) == -1)
28: perror (*av);
29: else renice (pid, 10);
30: exit (errno);
31: }
32: else if (submit (getpid ()) == -1)
33: error ("submit");
34: else nice (10);
35:
36: if (!strcmp ("-c", *av)) {
37: execl ("/bin/csh", "csh", "-c", *++av, 0);
38: error ("csh");
39: }
40: else {
41: execvp (*av, av);
42: error (*av);
43: }
44:
45: default:
46: exit (0);
47: }
48: }
49:
50: isnumber(s)
51: register char *s;
52: {
53: while (*s)
54: if (!isdigit(*s++))
55: return(0);
56: return(1);
57: }
58:
59: error (s)
60: register char *s;
61: {
62: perror (s);
63: exit (errno);
64: }
Defined functions
error
defined in line
59; used 4 times
main
defined in line
9;
never used
Defined variables