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
Which Command is Used for temprary switch User?
What are grep patterns?
How to see unused port number in Solaris?
what are filters?
Explain ‘library functions’ with respect to unix commands?
Give Command that will move a single file called "unix.txt"
Which command can you use to find the currently running process in unix server?
If we want to see first 35 lines of a file which command we have to use?
What command will bring user back to their home directory in UNIX?
Give the command to display space usage on the UNIX file system.
hw will u use awk in replacing cahrs and files
Is there any method to erase all files in the current directory, along with its all sub-directories, by using only one command?