blob: 188f1b5b6880d567eef9cb6e6acd35d3bbc9edc9 [file] [log] [blame]
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
char *progname;
static __noreturn usage(void)
{
fprintf(stderr, "Usage: %s pid\n", progname);
exit(1);
}
int main(int argc, char *argv[])
{
long pid;
char *endp;
progname = argv[0];
if (argc != 2)
usage();
pid = strtol(argv[1], &endp, 10);
if (*endp != '\0') {
perror("pid");
usage();
}
if (kill(pid, SIGTERM) == -1) {
perror("kill");
exit(-1);
}
exit(0);
}