I am working on a code which has several processes forked(). (linux - KDevelop)
The processes after they were created runs paralell in the background.
I want to read on a command line (like cinn >> kill=1 ) which tells the main process to kill all the childs and the main p., but I dont exactly know which process reads the input on the console.
How works the consol after forking. Which process reads the data from it?
I was trying to pass state values like kill=1, which should tell to all child processes that they should execute their ending processes and tell to the main process if it was succesful.
But I cant just pass any value to childs. I was trying with global variables (kill, processStatus1) but it did not work. Than I try pointers with same result.
int kill;
int processStatus1;
int main()
int child1, child2, child3 ...
child1 = fork();... calls the refresh function for example...
child2 = fork();... calls the virtualSpace function ...
and so on...
kill =1;
How can I make this interaction between child and main processes?