?
What is the output of the below code?
What is the output of the below code?
void exit_handler1();
void exit_handler2();
int main()
{
int pid;
atexit(exit_handler1);
atexit(exit_handler2);
pid = fork();
if(pid == 0)
{
_exit(0);
}
else
{
sleep(2);
exit(0);
}
return 0;
}
void exit_handler1();
void exit_handler2();
int main()
{
int pid;
atexit(exit_handler1);
atexit(exit_handler2);
pid = fork();
if(pid == 0)
{
_exit(0);
}
else
{
sleep(2);
exit(0);
}
return 0;
}
Join the Discussion
Login to post a comment or share your explanation.
Login