logo

Crowdly

Browser

Add to Chrome

Consider the following code. int main() {     pid_t pid = fork();     if ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Consider the following code.

int main() {

    pid_t pid = fork();

    if (pid > 0) {

     sleep(2);

        exit(0);

    } else if (pid == 0) {

        sleep(10);

    } else { // fork failed

        ;

    }

    exit(0);

}

Assuing that fork succeeds, and 10 seconds is a good enough delay to achieve what the program intends to do, and considering x6 environment

which one of the following is correct:

0%
0%
0%
0%
0%
0%
0%
More questions like this

Want instant access to all verified answers on moodle.coep.org.in?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome