qfedu-linux-advanced-level/day3/t12.c

19 lines
339 B
C
Raw Normal View History

2023-08-17 09:20:18 +08:00
#include <stdio.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
// kill 案例
int main()
{
// -3493 干掉 3493 进程组的所有进程
int s = kill(-3493, SIGKILL);
if (s == -1)
{
perror("kill");
return 1;
}
printf("kill result: %d\n", s);
return 0;
}