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 FIND, GREP and SED ? Could you please give me the difference between all the three? Where we use this commnands?

6 Answers   Deloitte, Polaris,


How does a user get the current date, time in UNIX?

6 Answers   IBM,


how to remotely move a file ??? that mean how to move a file one machine to another machine ???

10 Answers   Altair,


What is {} in find command?

0 Answers  


Explain command to display different lines that are found when compare two files?

0 Answers  


distinguish between user mode and kernel mode?

6 Answers   Infosys,


what does a process mean?

7 Answers   Infosys,


which command is used to identify the type of the file?

3 Answers  


Which command is used to create a directory?

0 Answers  


What do know about tee command?

0 Answers  


What is a Unix signal, and how do you handle them?

2 Answers  


How do you change file permissions?

1 Answers  


Categories