If after a fork()
is called the program should continue from the first instruction following the fork, why then the word START gets printed two times?
#include<stdio.h>
#include<unistd.h>
int main(){
int pid;
printf("START...");
pid = fork();
printf("%d: I've got %d\n", getpid(), pid);
return 0;
}
For example a possible output is:
START...605: I've got 606
START...606: I've got 0