Please make sure that you're using the same edition of the book. There is no guarantee that older editions use the same numbering for problems. Please submit a single tar file.
Be sure to include all necessary error checking, including ensuring that the source file exists. Also be sure to close the input and output files when the program completes. Once you have correctly designed and tested the program, run the program using a utility that traces system calls. For example, Linux systems provide the strace utility for tracing system calls. If the executable file is called filecopy, the strace command is invoked as follows:
strace ./filecopy
Next, answer the following questions (this will require carefully examining the output of system calls):
fork()
both with and without
exec()
. (a) Using gettimeofday()
, determine
how long it takes for the child to be created, i.e., just before the
fork until after the fork()
. (b) Then exec()
a minimal program that does nothing, i.e., simply has an empty
main()
and measure how long it takes to execute that
program, i.e., until the parent process wait()
returns.