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 clustering in HP and how it's work?
What do know about tee command?
What is the functions of zambie process?
What is the command to find hidden files in the current directory?
The rm command removes links to file. What does this mean? How then is a file deleted from the file system?
how will u execute a file in unix
What are the dos commands?
what are the different hardwares available?
what is the difference between pipe(|) and tee command..
What is the use of pipes?
what do you understand by 'building block primitive'?
What does the “echo” command do?