好吧,我試圖做一個簡單的功能不斷地改變其PID, 但我得到這個:錯誤:「SIGKILL」未申報(在一次使用此功能)
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();
}
}
這也可能幫助,http://stackoverflow.com/questions/6501522/how-to-kill-a-child-process-by-the-parent-process – D4zk1tty
#include http://unixhelp.ed.ac.uk/ CG I/man-cgi?signal + 2 –
Alexis