logo

Crowdly

Browser

Додати до Chrome

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

✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.

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%
Більше питань подібних до цього

Хочете миттєвий доступ до всіх перевірених відповідей на moodle.coep.org.in?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!

Browser

Додати до Chrome