好吧,我试图做一个简单的函数来不断改变它的PID,但我明白了:
error: ‘SIGKILL’ undeclared (first use in this function)
这是我的代码:
#include <stdio.h>
int changePID(void) {
int pid = fork();
printf(pid);
sleep(3);
kill(pid, SIGKILL);
}
int main(void) {
while (1) {
changePID();
}
}