The main process in my program forks 3 more process with say process ids as pid1, pid2, pid3. Pid1 and pid2 processes are in infinite loop. What I want is when pid3 process is over all the process including the main are terminated. As of now, I am using :
wait(pid3);
kill(0, SIGKILL);
which do all above as i said, but it prints Killed on the terminal. I don't want the signal to display killed and infact nothing, but gracefully exits from the program. How can I do that?