Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Post New Answer

More Unix Commands Interview Questions

What is the use of the command 'ls -x chapter[1-5]' ?

0 Answers  


What is the use of touch command in there?

1 Answers   Accenture,


What is the search command in unix?

0 Answers  


Name the general commands in using unix os for a beginner?

0 Answers  


what is the difference between Touch & cat command

21 Answers   QA,


How do I find previous commands in unix?

0 Answers  


Give Command that will move a single file called "unix.txt"

7 Answers   IBM,


What is .sh file?

0 Answers  


when we installing aix os the ssh installed default?

2 Answers  


What are bash commands?

0 Answers  


Where can I get the free download of Unix by Yeswant Kanetkar?

5 Answers  


what does a process mean?

7 Answers   Infosys,


Categories