ExamVeda
Login
Home
This question belongs to Computer Science Linux
Linux
?

What is the output of the below code?
void sig_handler ( int signum) {
    printf(“Handled the signal\n”);
}
 
int main() {
    int pid;
    signal (SIGKILL, sig_handler);
    pid = fork();
    if (pid==0) {
        kill(getppid(), SIGKILL);
        exit(0);
    } else {
        sleep(20);
    }
    return 0;
}

Answer & Solution
Correct Answer: Option D
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.