Hi there
i've got this type of thing in a function
Code:
int function1(char *buf, int *size, int options)
{
forking
if child{
function2(buf,size);
printf("buf of child:%s",buf); //OK
}
if parent{
//using semaphores i made this part guaranteed to run after the child returned from function2
printf("buf of parent:%s",buf);//empty :s
}
}
function 2 then changes the value of the buf and are returns the changed value through the parameter... I want such that buf is ok when printed from the parent that is will also be the new updated value for whoever calls function1 in the first place... the problem is not how to make the parent run after i did that already... i need to know how to return buf...
Thanks