Why my child process starts from the first line of main? When I run my program, "Hello There" will be printed twice. Child process should start on the line after fork, am I right?
int main(){
printf("Hello There!");
pid_t PID;
PID = fork();
if(PID == 0){
//Child
}
else{
//parent
}
}
This is huge problem to me because in my real program, I'm making private file with mmap before fork. And because of this what happens to me, parent and child have different private files..