#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
printf("I will die\n");
sleep(2);
abort();
raise(SIGKILL);
kill(getpid(), SIGKILL);
exit(0);
}
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
printf("I will die\n");
sleep(2);
abort();
raise(SIGKILL);
kill(getpid(), SIGKILL);
exit(0);
}
本文标题:linux c 三种方法退出本进程
本文链接:https://www.haomeiwen.com/subject/agicoctx.html
网友评论