#include
#include
#include
#include
int main(){
alarm(4);
int pid=fork();
while(1){
if(pid==0)
printf(“I am the child \n”);
else
printf(“I am the parent, child pid=%d\n”, pid);
sleep(1);
}
}
#include
#include
#include
#include
int main(){
alarm(4);
int pid=fork();
while(1){
if(pid==0)
printf(“I am the child \n”);
else
printf(“I am the parent, child pid=%d\n”, pid);
sleep(1);
}
}