killall.c revision ff9ee8fc15e1a41bffe06bfcee30368e7c117601
1ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley/* vi: set sw=4 ts=4:
2ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley *
3ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley * killall.c - Send a signal (default: TERM) to all processes with the given names.
4ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley *
5ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley * Copyright 2012 Andreas Heck <aheck@gmx.de>
6ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley *
7ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley * Not in SUSv4.
8ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley * See http://opengroup.org/onlinepubs/9699919799/utilities/
9ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley
10ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob LandleyUSE_KILLALL(NEWTOY(killall, "?lq", TOYFLAG_USR|TOYFLAG_BIN))
11ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley
12ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landleyconfig KILLALL
13ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	bool "killall"
14ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	default y
15ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	help
16ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	  usage: killall [-l] [-q] [-SIG] PROCESS_NAME...
17ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley
18ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	  Send a signal (default: TERM) to all processes with the given names.
19ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley
20ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley		-l	print list of all available signals
21ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley		-q	don't print any warnings or error messages
22ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley*/
23ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley
24ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#include "toys.h"
25ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley
26ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#define FLAG_q	1
27ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#define FLAG_l	2
28ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley
29ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob LandleyDEFINE_GLOBALS(
30ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley		int matched;
31ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley		int signum;
32ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley)
33ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#define TT this.killall
34ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley
35ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landleystruct signame {
36ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	int num;
37ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	const char *name;
38ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley};
39ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley
40ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landleystatic struct signame signames[] = {
41ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGHUP
42ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGHUP, "HUP"},
43ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
44ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGINT
45ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGINT, "INT"},
46ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
47ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGQUIT
48ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGQUIT, "QUIT"},
49ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
50ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGILL
51ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGILL, "ILL"},
52ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
53ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGTRAP
54ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGTRAP, "TRAP"},
55ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
56ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGTABRT
57ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGABRT, "ABRT"},
58ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
59ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGTABRT
60ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGIOT, "IOT"},
61ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
62ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGBUS
63ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGBUS, "BUS"},
64ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
65ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGFPE
66ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGFPE, "FPE"},
67ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
68ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGKILL
69ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGKILL, "KILL"},
70ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
71ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGUSR1
72ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGUSR1, "USR1"},
73ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
74ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGSEGV
75ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGSEGV, "SEGV"},
76ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
77ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGUSR2
78ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGUSR2, "USR2"},
79ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
80ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGPIPE
81ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGPIPE, "PIPE"},
82ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
83ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGALRM
84ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGALRM, "ALRM"},
85ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
86ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGTERM
87ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGTERM, "TERM"},
88ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
89ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGSTKFLT
90ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGSTKFLT, "STKFLT"},
91ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
92ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGCHLD
93ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGCHLD, "CHLD"},
94ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
95ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGCONT
96ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGCONT, "CONT"},
97ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
98ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGSTOP
99ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGSTOP, "STOP"},
100ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
101ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGSTOP
102ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGSTOP, "STOP"},
103ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
104ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGTSTP
105ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGTSTP, "TSTP"},
106ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
107ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGTTIN
108ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGTTIN, "TTIN"},
109ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
110ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGTTOU
111ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGTTOU, "TTOU"},
112ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
113ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGURG
114ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGURG, "URG"},
115ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
116ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGXCPU
117ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGXCPU, "XCPU"},
118ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
119ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGXFSZ
120ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGXFSZ, "XFSZ"},
121ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
122ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGVTALRM
123ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGVTALRM, "VTALRM"},
124ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
125ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGVTALRM
126ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGVTALRM, "VTALRM"},
127ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
128ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGPROF
129ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGPROF, "PROF"},
130ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
131ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGWINCH
132ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGWINCH, "WINCH"},
133ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
134ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGIO
135ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGIO, "IO"},
136ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
137ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGPOLL
138ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGPOLL, "POLL"},
139ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
140ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGPWR
141ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGPWR, "PWR"},
142ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
143ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGSYS
144ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGSYS, "SYS"},
145ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
146ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#ifdef SIGUNUSED
147ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{SIGUNUSED, "UNUSED"},
148ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley#endif
149ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	{0, NULL}
150ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley};
151ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley
152ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landleystatic int sig_to_num(const char *pidstr) {
153ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	int i, num;
154ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley
155ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	if (isdigit(pidstr[0])) {
156ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley		num = atoi(pidstr);
157ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley
158ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley		return num;
159ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	}
160ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley
161ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	for (i = 0; signames[i].num; i++) {
162ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley		if (strcmp(pidstr, signames[i].name) == 0) {
163ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley			return signames[i].num;
164ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley		}
165ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	}
166ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley
167ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	return -1;
168ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley}
169ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley
170ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landleystatic void print_signals() {
171ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	int i;
172ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley
173ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	for (i = 0; signames[i].num; i++) {
174ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley		puts(signames[i].name);
175ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	}
176ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley}
177ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley
178ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landleystatic void kill_process(const char *pidstr) {
179ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	int ret;
180ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	pid_t pid = atoi(pidstr);
181ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley
182ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	TT.matched = 1;
183ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	ret = kill(pid, TT.signum);
184ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley
185ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	if (ret == -1) {
186ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley		if (toys.optflags & FLAG_q) perror("kill");
187ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	}
188ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley}
189ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley
190ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landleyvoid killall_main(void)
191ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley{
192ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	char **names;
193ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley
194ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	TT.matched = 0;
195ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	TT.signum = SIGTERM;
196ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley
197ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	if (toys.optflags & FLAG_l) {
198ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley		print_signals();
199ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley		exit(0);
200ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	}
201ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley
202ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	if (!*toys.optargs) {
203ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley		toys.exithelp = 1;
204ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley		error_exit("Process name missing!");
205ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	}
206ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley
207ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	names = toys.optargs;
208ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley
209ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	if ((*toys.optargs)[0] == '-') {
210ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley		TT.signum = sig_to_num(&(*toys.optargs)[1]);
211ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley		if (TT.signum <= 0) {
212ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley			if (toys.optflags & FLAG_q) fprintf(stderr, "Invalid signal\n");
213ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley			exit(1);
214ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley		}
215ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley		names = ++toys.optargs;
216ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	}
217ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley
218ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	if (!*names) {
219ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley		toys.exithelp = 1;
220ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley		error_exit("Process name missing!");
221ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	}
222ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley
223ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	for_each_pid_with_name_in(names, kill_process);
224ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley
225ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	if (!TT.matched) {
226ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley		if (!(toys.optflags & FLAG_q)) fprintf(stderr, "No such process\n");
227ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley		exit(1);
228ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley	}
229ff9ee8fc15e1a41bffe06bfcee30368e7c117601Rob Landley}
230