Fork example
int i, pid;
i = 5;
printf( “%d\n”, i );
pid = fork();
if( pid == 0 )
i = 6; /* only the parent gets to here */
else
i = 4; /* only the child gets to here */
printf( “%d\n”, i );
Previous slide
Next slide
Back to first slide
View graphic version