0% found this document useful (0 votes)
29 views1 page

Obey Your Signals: CSC 209H Summer 2004: Assignment 3 (10% of Final Mark) Due Date: July 14, 2004

The document provides instructions for Assignment 3 which is due on July 14, 2004. Students are tasked with writing a C program called "runprog" that will execute another program, kill it if it runs over a time limit using a non-catchable signal, redirect its standard output to a file, and report its termination status. Runprog takes optional arguments to specify the time limit and output file. It will execute the specified program and any arguments. Students must also write a test program and include its source code with their submission. Electronic submission of all source code is required along with a printed copy for the TA by the due date.

Uploaded by

SateeshReddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views1 page

Obey Your Signals: CSC 209H Summer 2004: Assignment 3 (10% of Final Mark) Due Date: July 14, 2004

The document provides instructions for Assignment 3 which is due on July 14, 2004. Students are tasked with writing a C program called "runprog" that will execute another program, kill it if it runs over a time limit using a non-catchable signal, redirect its standard output to a file, and report its termination status. Runprog takes optional arguments to specify the time limit and output file. It will execute the specified program and any arguments. Students must also write a test program and include its source code with their submission. Electronic submission of all source code is required along with a printed copy for the TA by the due date.

Uploaded by

SateeshReddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

CSC 209H Summer 2004: Assignment 3 (10% of final mark)

Due date: July 14, 2004

Obey your Signals


The idea for this assignment is inspired by our auto-testing software. If a student's
program has an infinite loop in it, we need a way to notice, and to stop the program.
You will write a C program called runprog that will execute another program. It will kill
the program if it runs beyond a certain time limit using a signal that the program cannot
catch. It will also redirect the program's standard output to a file, so that we can look at it
later (this should be done whether or not the time limit is exceeded). Finally it will report
the termination status (to stderr) of the child.
runprog takes two optional arguments: -t <timelimit> and -o <output file> where
timelimit is the amount of time to wait before killing the process, and output file is

the name of the output file to redirect the standard output of the program. The remaining
arguments are the name of the program to execute and its arguments (if any). The default
value of timelimit should be 10 seconds. If an output file is not specified, you do not
need to redirect standard output.
For example, suppose I have an executable called wastetime in my current working
directory, then I can run it from runprog as follows:
runprog -t 5 -o junk wastetime

If wastetime takes longer than 5 seconds runprog will kill it. Anything wastetime has
written to standard out will be in the file called junk.
You will want to write at least one program to help you test runprog. You do not need to
hand this program in electronically but do include the source code for this in your paper
submission.
Submission
All assignments in this course require you to submit all your source code electronically.
You are also required to hand-in a printed version of your code and the testing you
performed to the TA in the tutorial when the assignment is due. Failure to follow this
may result in a grade of 0 on the assignment. In addition, we may perform electronic
testing on your program. The conventions specified in this handout should be sufficient
but keep checking the newsgroup for updates/corrections.
Enjoy!

You might also like