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
How to get the operating system's information in unix?
What does this command do? Cat food 1 > kitty
what is the use of the hidden files?
How to know a process is a zombie or orphan process?
what is the command to list all files in a directory, including the hidden files in UNIX ?
what is ls -ltd?
what are wild cards?
Explain command to display different lines that are found when compare two files?
how to delete entire records in unix ?
What are grep patterns?
what is mount ,tell me about mount ,how can u use in real time project??
How do you remove a crontab file?