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 set sticky bit, or it have any seperate directory to create sticky bit in sunfir servers. Please help me , i don't no the exact answer?
Which command can you use to find the currently running process in unix server?
What is the nmap command?
how to unzip the contents of the gzip file
what is the advaantage of each user having its own copy of the shell?
Who wrote grep?
How do you create a directory in UNIX?
What do chmod command do?
What is the command to find hidden files in the current directory?
what is the command to find out the difference between files and folders?
What are awk commands?
What is grep short for?