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
What is the use of the command 'ls -x chapter[1-5]' ?
What is the use of touch command in there?
What is the search command in unix?
Name the general commands in using unix os for a beginner?
what is the difference between Touch & cat command
How do I find previous commands in unix?
Give Command that will move a single file called "unix.txt"
What is .sh file?
when we installing aix os the ssh installed default?
What are bash commands?
Where can I get the free download of Unix by Yeswant Kanetkar?
what does a process mean?