#include <stdio.h>
#include <stdlib.h>
int main()
{
int pid = 0;
printf("before the fork
");
pid = fork(); //create the child process
printf("after the fork
");
if (pid == 0)
{
printf("I'm the child process, my pid is &d
", getpid());
exit(1);
}
else
{
printf("I'm the parent process, my pid is &d
", getpid());
exit(0);
}
}