CS111 - Project 0: Warm-Up

INTRODUCTION:

Every quarter a few students come into this course without basic C software development skills, and invest a great deal of time and frustrating effort in the first two projects before concluding they will fail the course and must drop. We have created this simple warm-up to determine whether or not students are prepared to work on C programming projects. Most students should find this project to be completely trivial (20 minutes of work). If you do not find this project to be trivial, you may want to reconsider whether or not you are ready to take this course.

RELATION TO READING AND LECTURES:

None. This project requires only skills that incoming students should already possess.

PROJECT OBJECTIVES:

DELIVERABLES:

A single tarball (.tar.gz) containing:

PROJECT DESCRIPTION:

  1. (if you do not already have one) bring up a Linux development environment. If you do not already have one and do not know how to do this, the local Linux Users Group can help you. Your development environment should include (at least): If do not want a personal Linux development environment, you can also work directly on a SEASNET server.
  2. (if you are not already familiar with them) study the following manual sections: Feel free to seek out other examples/tutorials for these functions, but make sure you cite those sources in your README.
  3. write a program that copies its standard input to its standard output by read(2)-ing from file descriptor 0 (until encountering an end of file) and write(2)-ing to file descriptor 1. If no errors (other than EOF) are encountered, your program should exit(2) with a return code of 0.

    Your program executable should be called lab0, and accept the following command line arguments (in any combination):

  4. create a Makefile that supports the following targets:
  5. run your program (with the --segfault argument) under gdb(1)
  6. run your program (with the --segfault argument) under gdb(1)

VALUE:

Points for this project will be awarded as follows:

Value Feature
packaging and build
5% untars expected contents
5% clean build w/default action
2% correct make check
1% correct make dist
2% reasonablness of README contents
5% reasonablness of smoke test
input/output features
10% correctly copy input to output
10% correctly implements --input
10% correct handling of non-existant input file
10% correctly implements --output
5% correct handling of un-openable/creatable output file
5% implements combined --input + --output
fault handling
5% generate (and die from) SIGSEGV
5% catch and report SIGSEGV
gdb use
5% screen shot showing taking of segfault within gdb
5% screen shot showing backtrace from segfault
5% screen shot showing breakpoint stop before fault
5% screen shot showing inspection of null pointer

SUBMISSION:

Your tarball should have a name of the form lab0-yourStudentID.tar.gz. and should be submitted via CCLE.

We will test it on a SEASnet GNU/Linux server running RHEL 7. You would be well advised to test all the functionality of your submission on that platform before submitting it.