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

distinguish between multi-tasking,multi-user,multi- processing and time sharing?

4 Answers   Infosys, Nikhil Construction,


What is the different between UNIX command and UNIX shell script?

2 Answers  


What is awk used for?

0 Answers  


What Is the command to change a file's creation time. means one file is created at the time 15:19 then time should br changed to 14:14

8 Answers   3i Infotech, IBM,


How to find $ai_serual resolved path by using unix

0 Answers  


What Command will remove a Directory in UNIX?

8 Answers   IBM,


What is unix command?

0 Answers  


What are the commands in UNIX to list the files in a Directory?

0 Answers   CGI,


What command a user use to view a long text file one page at a time in UNIX?

8 Answers   IBM,


What is the difference between cat and more command?

0 Answers  


Explain ‘system calls’ with respect to unix commands?

0 Answers  


What is grep in bash?

0 Answers  


Categories