Course CSE376
Title Advanced Systems Programming in Unix/C
Credits 3
Course Coordinator

Erez Zadok


Focuses on several aspects of producing commercial-grade system software: reliability, portability, security, and survivability. Uses UNIX and C, heavily use in industry when developing systems and embedded systems code. Emphasizes techniques and tools to produce reliable, secure, and highly portable code. Requires substantial programming as well as a course project.

Prerequisite C or higher: CSE 219 or 260; CSE 320 or 230 or ESE 224 or ESG 111; CSE or ECE major
Course Outcomes
  • An understanding of the key objectives for highly-reliable commercial-grade systems software, e.g. portability, security, and robustness.
  • An ability to apply software development techniques for achieving these objectives using the C programming language.
  • Working knowledge of Unix system development tools and debugging.



Major Topics Covered in Course
  • Overview of C language
  • Advanced C programming techniques
  • C Preprocessing and inner-working of CPP
  • Unix system calls and libc calls, differences
  • Differences between C compilers (ANSI, K&R, GCC)
  • Inner-working of C compilers: cpp, ccom, as, ld
  • Highly-robust error handling: surviving partial system failures
  • Emphasis on error-handling at every stage
  • Use of preconditions, assertions and comments in code
  • Emphasis on code readability and correctness, often instead of efficiency
  • Some level of redundancy in coding, e.g., not relying on preconditions to hold, expect and tolerate errors elsewhere in the code etc.
  • Unix process structure: text (+shlib), stack, heap
  • Static libraries
  • Shared libraries, memory mapping, versioning
  • Memory management using malloc/free, static/automatic/dynamic variables
  • Pointers, pointers, pointers
  • Bug detection, avoidance, and fixing
  • Writing code to avoid common C mistakes that are not caught by compilers
  • Advanced tools for memory corruption bugs
  • Stack overflow bugs: detection in user-land and kernel
  • Writing portable code on multiple Unix systems: unnamed, CPP, older techniques
  • Advanced Makefiles using GNU Make
  • Portability autotools: Autoconf, Automake, and Libtool
  • Unix user-level tools: cvs, g/cc, as, ld, ranlib, cpp, ls, cd,...
  • Unix manual pages
  • Unix shell scripts

Laboratory Projects
  • 3 weeks: write a user-level file encryption program, running on three systems.
  • 3 weeks: write 20+ small programs to demonstrate various common C programming mistakes that cannot be caught with GCC, but can be caught with a bounds-checking compiler such as BCC and tools such as ElectricFence.
  • 3-4 weeks: port a unix tool to several different Unix systems, writing shell scripts and Makefile templates to automatically generate C code headers; use tools learned thus far in class to cleanup this older Unix code and catch bugs.
  • 4-5 weeks (class project): port a UNIX tool for one-time authentication key generation system to over a dozen UNIX systems, using GNU Autotools.

Course Webpage