The following process does not continue after running kill -SIGCONT pid from another terminal.
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("paused\n");
pause();
printf("continue\n");
return 0;
}
I expect the program to continue after sending the signal and printing “continue”. How come this doesn’t work as expected?
pause()is documented toBut SIGCONT only continues a process previously stopped by SIGSTOP or SIGTSTP.
So, you might want to try:
Instead of your
pause()Also, you might want to look at
sigsuspend().