Hi, i want that the parent process start before the child, this code doesn't work,
if the child start before the parent it wait for signal, then the father send the signal SIGALRM and the child catch it and call printf;
else the father call printf and send the signal to the child that call its printf;
in any case nothing happens:
#include <signal.h>
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
void catch(int);
int main (void) {
pid_t pid;
pid = fork();
if (!pid){
signal(SIGALRM,catch);
pause();
} else{
kill(pid,SIGALRM);
printf("start the father\n");
}
}
void catch(int signo) {
printf("start the child");
}