✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.
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 exec1cc 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.
Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!