Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Type the following C program to see the function of exec() system call: #include char *myargs[] = { ls, -l, NULL }; int main() {

Type the following C program to see the function of exec() system call:

#include

char *myargs[] = {

"ls",

"-l",

NULL

};

int main()

{

int i;

if (fork()==0)

{

execvp("ls",myargs);

printf("NEVER PRINTED ");

exit(0);

}

else

{

for (i=0;i<5;i++)

{

printf("PARENT: %d ",i);

sleep(1);

}

}

printf("DONE ");

return 0;

}

Questions:

How could you convert the parent to a long-running process? Convert it and then put it in the background. Report the status and PID.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago