First, I'm sorry about my English writing skills.
I'm studying about signal in Linux Kernel and I got a problem about signal handler and output buffer.
I just want to know about stdout buffer related parent process and child process.
The problem is - parent process received SIGINT signal_handler that I implement is called.
And after signal_handler is called, it print string "pid : xxx state : RUNNING" ... but after end of signal_handler function, child process might be print string but it isn't print at all.
I'm not asking right code, but I want to know why is this happened and concepts about signal handler, buffer - between parent process and child process.
here is a code signal_handler:
pid = GetProcessId();
ps = GetProcessState( pid );
case PROC_STATE_RUNNING :
printf("pid : %d, state : RUNNING\n", pid);
case PROC_STATE_READY :
printf("pid : %d, state : READY\n", pid);
case PROC_STATE_BLOCKED :
printf("pid : %d, state : BLOCKED\n", pid);
printf("Out of range\n");
this is the signal handler for SIGINT.
chlid process counts number in infinite loop, but after call signal_handler, it can't print at all.. just waiting for SIGINT..
What is the problem and What is the concepts that I missing...?
Thank you for reading.