I don't really know what you want to describe with "And after that I want the child comes up again" but I assume you want to execute the child part of the code?
In the manpage for vfork you can find:
vfork() differs from fork(2) in that the calling thread is suspended until the child terminates (either normally, by calling _exit(2), or abnormally, after delivery of a fatal signal), or it makes a call to execve(2). Until that point, the child shares all memory with its parent, including the stack. The child must not return from the current function or call exit(3), but may call _exit(2).
Since you exit the child process you either have to fork a new one or call exec from the child and modify the code so that the child only run it's part of it.
Asked in February 2016Viewed 3,458 timesVoted 12Answered 1 times