Question: PLZ DO NOT COPY PASTE FROM ANOTHER CHEGG!!!!!PLZ DO NOT COPY PASTE FROM ANOTHER CHEGG!!!!!PLZ DO NOT COPY PASTE FROM ANOTHER CHEGG!!!!!PLZ DO NOT COPY
PLZ DO NOT COPY PASTE FROM ANOTHER CHEGG!!!!!PLZ DO NOT COPY PASTE FROM ANOTHER CHEGG!!!!!PLZ DO NOT COPY PASTE FROM ANOTHER CHEGG!!!!!PLZ DO NOT COPY PASTE FROM ANOTHER CHEGG!!!!!PLZ DO NOT COPY PASTE FROM ANOTHER CHEGG!!!!!PLZ DO NOT COPY PASTE FROM ANOTHER CHEGG!!!!!PLZ DO NOT COPY PASTE FROM ANOTHER CHEGG!!!!!PLZ DO NOT COPY PASTE FROM ANOTHER CHEGG!!!!!PLZ DO NOT COPY PASTE FROM ANOTHER CHEGG!!!!!

This handout describes the exec family of functions, for executing a command. You can use these functions to make a child process execute a new program after it has been forked. The functions in this family differ in how you specify the arguments, but they all do the same thing. They are declared in the header file 'unistd.h'. execv (char *filename, char *const argv[]) The execv function executes the file named by filename as a new process image. The argy argument is an array of null-terminated strings that is used to provide a value for the argu argument to the main function of the program to be executed. The last element of this array must be a null pointer. execup (char *filename, char *const argv[]) The execvp function is similar to execv, except that it searches the directories listed in the PATH environment variable to find the full file name of a file from filename if filename does not contain a slash. This function is useful for executing system utility programs, because it looks for them in the places that the user has chosen. Shells use execvp to run the commands that users type. execl (char *filename, const char *argo, ...) This is similar to execv, but the argv strings are specified individually instead of as an array. A null pointer must be passed as the last such argument. execlp (char *filename, const char *argo, ...) This function is like execl, except that it performs the same file name searching as the execvp function. Example 1: Using execv(...) command Note: This version will not search the path, so the full name of the executable file must be given. Parameters to main() are passed in a single array of character pointers. #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
