Advanced Programming in the
UNIX Environment

by W. Richard Stevens
Addison-Wesley Professional Computing Series
0-201-56317-7 * Hardcover * 768 pages * ©1992
[Buy this book]

Chapter 1. Introduction

Introduction * Logging In * Files and Directories * Input and Output * Programs and Processes * ANSI C Features * Error Handling * User Identification * Signals * Unix Time Values * System Calls and Library Functions * Summary

Example Relevant Functions
1.1 List all files in a directory opendir, readdir, closedir
1.2 Copy standard input to standard output (unbuffered) read, write
1.3 Copy standard input to standard output (buffered, using stdio) getc, putc, ferror,
1.4 Get process ID getpid
1.5 mini-shell: read commands from stdin and execute them fgets, fork, execlp, waitpid
1.6 Print system errors strerror, perror, errno
1.7 Print User-ID and Group-ID getuid, getgid
1.8 mini-shell (read & exec commands) + basic signal handling fgets, fork, execlp, waitpid, signal,
SIGINT, SIG_ERR