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 tee command?

0 Answers  


Why is shebang used?

0 Answers  


What happens when we execute a unix command?

0 Answers  


How do you change file permissions and ownership in Unix?

2 Answers  


What is command statement?

0 Answers  


In UNIX, what is the command to edit contents of the file?

9 Answers  


Give Command that will change the name of a directly from paypal to eBay

3 Answers   Alcatel, IBM,


In Unix file permissions what does the second field denotes?

3 Answers  


What is the functions of zambie process?

3 Answers  


Why is it called grep?

0 Answers  


What is the Unix file system hierarchy?

2 Answers  


What Command is used to make a directory?

4 Answers   IBM,


Categories