Lab 6 Solution


Category: Tag:


You answers will be in the form of a PDF/C Code.

In class we discussed the basics of fork and exec. Using your makeArgs.c and makeArgs.h

  1. Copy makeArgs.c into the folder tokenize

  1. I have provided a C file named cscd340Lab6.c. You must write the forkIt function in process.c This function will:

    1. fork() and store the result

    1. check the result of fork() if in the parent – issue a waitpid command waiting for the pid

    1. if the result of the fork() indicates the child – issue the appropriate execvp command

    1. Check the results of the exec command – if the execvp command was invalid issue an exit to kill the child

Run your code with multiple commands both valid and invalid and capture the valgrind output. Store the valgrind output in a PDF.

NOTE: The grader will be running simple commands (both valid and invalid) such as ls -l, pwd, pwe, ls – al, make, etc.


  1. zip

Your PDF of your valgrind run Your C files

You will submit a zip file named your last name first letter of your first name (Example

error: Content is protected !!