Write a program to create three child process. The parent process send the signal to terminate all these child processes.
#include
#include
main()
{
int pid[3],status,i;
for(i=0;i<3 i="" p=""> {
pid[i]=fork();
printf("\n new created child process value is :%d",pid[i]);
}
for(i=0;i<3 i="" p=""> {
if(pid[i])
{
printf("for terminate the process \n");
kill(pid[i],9);
printf("termination of the child process :%d \n ",pid[i]);
}
}
}
}3>3>
#include
main()
{
int pid[3],status,i;
for(i=0;i<3 i="" p=""> {
pid[i]=fork();
printf("\n new created child process value is :%d",pid[i]);
}
for(i=0;i<3 i="" p=""> {
if(pid[i])
{
printf("for terminate the process \n");
kill(pid[i],9);
printf("termination of the child process :%d \n ",pid[i]);
}
}
}
}3>3>
Comments
Post a Comment