CS 3733 Operating Systems, Fall 2004 Recitation Session 1
Week of August 30.
Recitations will meet in the Linux Lab, 3.01.04 SB.
The purpose of this session is to make you familiar with the Linux Lab
environment.
- Log on to your account in the Linux Lab.
- Set up the windowing environment to your liking.
- Make sure you have a cs3733 directory somewhere in your account.
- Create a Rec01 subdirectory.
- Access the USP web site:
/usp
- Click on the Programs link.
- Download the (uncompressed) tar file for chapter 5.
- Untar the files into your Rec01 directory.
- Run the convertlinux script to modify the makefile.
- Compile all of the programs from Chapter 5 of USP by executing
make.
- Execute the program
This should show the access time for the files in this directory..
- Read pages 154 and 155 of USP starting with section 5.2.1.
You can find these pages online here.
- Copy printaccess.c into get_modify_time.c.
Modify get_modify_time.c so that the name of the function
is get_modify_time.
Instead of printing information, this function
will return a time_t which is the st_mtime field of the
structure.
The function does not perform any I/O.
If the call to stat fails, the function returns (time_t)-1.
You should be able to remove stdio.h from the includes.
- Get a copy of the program test_get_modify_time.c that is
available here to test your
function.
Modify the makefile to compile test_modify.c
and get_modify_time.c to produce the executable
test_get_modify_time.
Run this as follows:
test_get_modify_time makefile
and convince yourself that it is working correctly.
Compare the results with the output of ls -l.
- Make sure the TA checks off that you completed this.