#include <stdio.h>
#include <unistd.h>
#include <signal.h>
int childpid;
void handler(int signum) {
printf("A\n");
kill(childpid,SIGCONT);
}
int main() {
int waitReturnPid;
signal(SIGCHLD, handler);
childpid = fork();
if (childpid == 0) {
sleep(1);
raise(SIGTSTP);
printf("B\n");
} else if (childpid > 0) {
wait(NULL);
printf("C\n");
}
}
Why is the output here
B
A
C
shouldnt it be
A
B
C
? i really dont get it please someone explain