pit_t pid = fork();
if (pid == -1){
abort();
} else if (pid == 0){
printf("this is child before\n");
ptrace(PTRACE_TRACEME);
raise(SIGSTOP);
printf("this is child after\n");
} else {
//waitpid(pid, NULL, WUNTRACED) for without ptrace
waitpid(pid, NULL, 0);
printf("this is parent\n");
}
without the ptrace line, this code works as expected, the second printf in child never gets printed since parent does not send SIGCONT. But with the ptrace line, the second printf in child does get printed. Why does the child continue to execute without receiving SIGCONT?
Thanks