-.TH KILLALL 1 2011-02-22 "Linux" "User Commands"
+.TH KILLALL 1 2012-06-16 "Linux" "User Commands"
.SH NAME
killall \- kill processes by name
.SH SYNOPSIS
.PP
If processes change their name, \fBkillall\fP may not be able to match
them correctly.
+.PP
+\fBkillall\fP has a limit of names that can be specified on the command line.
+This figure is the size of an unsigned long multiplied by 8. For most 32
+bit systems the limit is 32 and similarly for a 64 bit system the limit is
+usually 64.
.SH AUTHORS
Werner Almesberger <werner@almesberger.net> wrote the original version
of psmisc. Since version 20 Craig Small <csmall@enc.com.au>
#define ER_OOFRA -4
#define NOT_PIDOF_OPTION if (pidof) usage(NULL)
+#define MYNAME ((pidof)?"pidof":"killall")
static int verbose = 0, exact = 0, interactive = 0, reg = 0,
quiet = 0, wait_until_dead = 0, process_group = 0,
char buf[2048];
FILE* file;
if (!(file=fopen( PROC_BASE "/uptime", "r"))) {
- fprintf(stderr, "error opening uptime file\n");
+ fprintf(stderr, "%s: error opening uptime file\n",MYNAME);
exit(1);
}
savelocale = setlocale(LC_NUMERIC, NULL);
fclose(f);
if (re==-1)
{
- fprintf(stderr, _("Cannot get UID from process status\n"));
+ fprintf(stderr, _("%s: Cannot get UID from process status\n"), MYNAME);
exit(1);
}
return re;
{
if (regcomp(®list[i], namelist[i], flag) != 0)
{
- fprintf(stderr, _("Bad regular expression: %s\n"), namelist[i]);
+ fprintf(stderr, _("%s: Bad regular expression: %s\n"), MYNAME, namelist[i]);
exit (1);
}
}
if (exact && !okay)
{
if (verbose)
- fprintf (stderr, _("skipping partial match %s(%d)\n"), comm,
- pid_table[i]);
+ fprintf (stderr, _("%s: skipping partial match %s(%d)\n"),
+ MYNAME, comm, pid_table[i]);
continue;
}
got_long = okay;
pgids[i] = id;
if (id < 0)
{
- fprintf (stderr, "getpgid(%d): %s\n", pid_table[i],
- strerror (errno));
+ fprintf (stderr, "%s: getpgid(%d): %s\n",
+ MYNAME, pid_table[i], strerror (errno));
}
for (j = 0; j < i; j++)
if (pgids[j] == id)
#endif
usage(NULL);
- if (argc - myoptind > MAX_NAMES + 1) {
- fprintf (stderr, _("Maximum number of names is %d\n"), MAX_NAMES);
+ if (argc - myoptind > MAX_NAMES) {
+ fprintf (stderr, _("%s: Maximum number of names is %d\n"),
+ MYNAME, MAX_NAMES);
exit (1);
}
if (!have_proc_self_stat()) {
- fprintf (stderr, _("%s lacks process entries (not mounted ?)\n"), PROC_BASE);
+ fprintf (stderr, _("%s: %s lacks process entries (not mounted ?)\n"),
+ MYNAME, PROC_BASE);
exit (1);
}
argv = argv + myoptind;