Here I encountered problem with printfs.
I am running number of processes using rc script on an embedded system ONT(Optical network terminal).
I have developed a packet sniffer application which captures RTP/RTCP packets on the network.
I am adding this process into rc script(onuInit) file for starting my application with other process while initing the board.
The problem comes now. I will not be able to see any printf traces which I supposed to print in packet-recorder application whenever I start capture, while other process are able to print the traces happily.
All the process are getting started as deamon(using fork) and my application too.
The strange thing here is I am able to see the printf traces in my application while init process completes, which is before a infinite while loop inside the message-handler thread which is reading the messages on queue, and once it reaches to the while loop it stops printind further traces. I am using msgrcv and checking for the number of bytes it read from the queue, if it is more than 0 then I process the message or else sleep for some time and try to read the queue again.
Now one more thing here if I kill my packet-recorder application and re-start it manually then I will be able to see my all printf traces
I have tried the following:
1) Bring–up the processes in different order.
2) Checked the stdin, stdout, stderr values (they all are fine and showing as 0, 1, 2).
3) ‘write’ is not working as it uses stdout.
4) File-writing fwrite and fprintf(both are working fine).
5) used _exit(0) instead exit(0).
Please can you suggest what can be the possible issues here.
I will be pleased to elaborate the issue if u find it non-understandable somewhere.
Thanks in advance.