Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

Edit the code given to do the tasks asked! Thumbs up for correct answer! Task 1*(100 points) There are many variations of the exec system

Edit the code given to do the tasks asked! Thumbs up for correct answer!

image text in transcribed

image text in transcribed

image text in transcribed

Task 1*(100 points) There are many variations of the exec system call that can be used to execute an executable file (program) Calling exec does not create a new process, it replaces the current process with the new process. If the exec command fails, then it returns -1. But if it succeeds it does not return because execution proceeds at the beginning of the program that was executed. We will consider some useful forms of exec commands. 1. execl: takes the path name of an executable as its first argument, the rest of the arguments are the command line arguments ending with a NULL. execl(" /bin/ls", "ls", "-a", "-1" , NULL 2. execv: takes the path name of a binary executable as its first argument, and a NULL terminated array of arguments as its second argument. The first element can be the command or " " " 1s", "-a", "-1", NULL; static char* args execv("/bin/ls", args) 3. execlp: same as execl except that we don't have to give the full path name of the command. execlp ("ls", "1s", "-a", "-1", NULL) 4. execvp: Same as exexv except that we don't have to give the full path name of the command. " 1s", "-a", "-1", NULL; static char* args execvp("ls ", args)

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_2

Step: 3

blur-text-image_3

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

Oracle 11G SQL

Authors: Joan Casteel

2nd Edition

1133947360, 978-1133947363

More Books

Students explore these related Databases questions