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:
what is the difference between SED and GREP ? Which one is more better and why?
What is awk command used for?
what are the different operating systems available?
How to get a particular string as your prompt ? Give syntax of that command?
What do know about tee command and its usage?
Can you write a command to erase all files in the current directory including all its sub-directories?
boot process?
describe the escaping sequence characteres in unix
what are the different commands used to create files?
when we installing aix os the ssh installed default?
what is virtual machine?
What is pipe command in unix?