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 clustering in HP and how it's work?

1 Answers   HP,


What do know about tee command?

0 Answers  


What is the functions of zambie process?

3 Answers  


What is the command to find hidden files in the current directory?

0 Answers  


The rm command removes links to file. What does this mean? How then is a file deleted from the file system?

5 Answers  


how will u execute a file in unix

8 Answers   QA,


What are the dos commands?

0 Answers  


what are the different hardwares available?

1 Answers  


what is the difference between pipe(|) and tee command..

3 Answers   Cap Gemini, Rolta,


What is the use of pipes?

4 Answers  


what do you understand by 'building block primitive'?

3 Answers   Infosys,


What does the “echo” command do?

0 Answers  


Categories