This commit is contained in:
Kolan Sh 2011-04-28 13:18:22 +04:00
commit 7c309f9481
2 changed files with 43 additions and 0 deletions

28
bash/signal/exec.c Normal file
View File

@ -0,0 +1,28 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
void sigv_handler(int signum)
{
printf("HANDLED!\n");
}
int main(int argc, char *argv[])
{
signal(SIGSEGV, SIG_IGN);
signal(SIGSEGV, SIG_IGN);
signal(SIGTERM, SIG_IGN);
signal(SIGABRT, SIG_IGN);
signal(SIGILL, SIG_IGN);
signal(SIGKILL, SIG_IGN);
//char *p = 102034543; int a = *p;
//while (1) {;};
execl("./signal", "", NULL);
return EXIT_SUCCESS;
}

15
bash/signal/signal.c Normal file
View File

@ -0,0 +1,15 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
char *p = 10232498;
int a = *p;
while (1)
usleep(100000);
return EXIT_SUCCESS;
}