Question
Execute the unmodified program and report on the results. Modify the cmd2 array so that instead of being assigned nullptr , cmd2[1] receives a strdup
Execute the unmodified program and report on the results.
Modify the cmd2 array so that instead of being assigned nullptr, cmd2[1] receives a strdup of "-l". What's the resulting difference in output, and why?
Try changing the argument "/bin/ls" in the call to execv to "ls". What did or did not happen in this call, and why?
Further modify the program from its state in item 3 by changing the call of execv to calling execvp. Again, what did or did not happen in this call, and why?
#include
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started