I am trying the following C code:
int main() { printf(\"text1\\n\"); fork(); printf(\"text2\\n\"); return 0; }
I was expect
The child process will start from the position of the fork(), so you are getting the correct output.