I wrote a code that goes into infinite loop to do periodic checks on a three-phase meter. To send data to the server in json format, I use a program written ad-hoc deals to take the data and send them to the server. The problem is that this mechanism works for a few hours. After this time the fork stop to call the program used for sending data and the program goes on.
In your opinion what could be the problem?
Thanks in advance for your response
P.S. Below the code used for fork()
int pid = fork();
if ( pid == 0 ) {
execlp("./json_send","./json_send",0);
} else {
printf( "\nParent process: %d", pid );
}