10 Points
Once forked, the child calls a function that
sleeps for a period of seconds.
The sleep time
in seconds is passed on the command line as the first argument to the
program.
Thus, there is
data sharing between parent and child.
After the child wakes up, it prints out the date and time
(do not use system("date")
to do the date; find
the underlying OS system and library call)
and terminates.
The printout should differentiate between parent and child.
If you have problems with I/O, then make sure to flush.
Turn in (bin outside Geoff's office) a copy of your
commented program
and a script file of its execution
(do a man script
if you do not know
what a script file is).
On the script file, differentiate between
parent and child output.
Script files end up with a lot of control characters. There
are at least 2 ways to remove them. One is to try the command
col
;
the other is to cat
the file to the screen and then
cut and paste.
Submit your source code and the script output by running
This is assignment number 01.
cs110submit
or
cs110submitall
. The script output must be named
script.txt or the submit system will not accept it.
Your source code must compile using
make
(in other words,
you need to submit a Makefile
with it).