logo

Crowdly

Consider the following programs exec1.c #include <unistd.h> #include <stdi...

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

Consider the following programs

exec1.c

#include <unistd.h>

#include <stdio.h>

int main() {

    execl("./exec2", "./exec2", NULL);   

}

exec2.c

#include <unistd.h>

#include <stdio.h>

int main() {

    execl("/bin/ls", "/bin/ls", NULL);   

   printf("hello\n");

}

Compiled as

cc     exec1.c   -o exec1

cc     exec2.c   -o exec2

And run as

$ ./exec1

Explain the output of the above command (./exec1)

Assume that /bin/ls , i.e. the 'ls' program exists.

0%
0%
0%
0%
0%
Більше питань подібних до цього

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

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