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

Which Command is Used for temprary switch User?

5 Answers   BitWise, IBM,


What are grep patterns?

0 Answers  


How to see unused port number in Solaris?

2 Answers   HCL,


what are filters?

6 Answers  


Explain ‘library functions’ with respect to unix commands?

0 Answers  


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

7 Answers   IBM,


Which command can you use to find the currently running process in unix server?

0 Answers  


If we want to see first 35 lines of a file which command we have to use?

8 Answers  


What command will bring user back to their home directory in UNIX?

13 Answers   IBM, Wipro,


Give the command to display space usage on the UNIX file system.

6 Answers  


hw will u use awk in replacing cahrs and files

0 Answers  


Is there any method to erase all files in the current directory, along with its all sub-directories, by using only one command?

0 Answers  


Categories