shared int between parent and child
whats the best method of sharing a variable between a child and a parent?
specifically I want the parent to exit successfully only if the child has initialised properly, otherwise exit with an error as well as the child.
//share this memory between parent and child
int confirm_ok = -1;
switch (pid = fork())
//do some initilisation stuff
confirm_ok = 0;
while(confirm_ok == -1)
if(confirm_ok == 1)