When i run a programm of orphan process. Instead of getting child's parent (ppid)=1 ..i get 1400 and it varies as per system.
How can i findthe right soluion???
My pgm:
#include<stdlib.h>
# include <stdio.h>
int main()
{
int pid;
pid=fork();
if(pid < 0)
{exit(-1);}
else if(pid==0)
{
printf("Child Process is Sleeping ...");
sleep(10);
printf("Orphan Child's Parent ID : %u
",getppid());
}
else
{
printf("Parent Process Completed ... %u
",getpid());
exit(0);
}
return 0;
}
Output:
No Answer is Posted For this Question
Be the First to Post Answer
If we want to see first 35 lines of a file which command we have to use?
What is the first character of the output in ls l command?
What is the use of egrep command in unix?
what is the command to find out the difference between files and folders?
How to copy multiple files and directories into some other directory?
Which command will print your home directory on screen?
What are bash commands?
solaris Run level?
Give Command that will change the name of a directly from paypal to eBay
Give the command to display space usage on the UNIX file system.
Name the general commands in using unix os for a beginner?
How to create hardlinks and softlinks on files?