A great book on Unix programming by Marc J. Rochkind, one of the many interesting researchers found at Bell Labs in the 70/80s. Rochkind, while not Brian Kernighan, Dennis Ritchie or Rob Pike, is without a doubt a Unix guru. Proof is this lies in the clear, elegant and "complexity is avoidable" attitude the book maintains, along with feeling of being some sort of kid in a candy store, well, substituting the candy for Unix system calls.

The book's prerequisite is a decent knowledge of C, an advanced user-level understanding of UNIX, and an inquiring mind willing to venture into an old, yet practical even today, book. This book shouldn't be used as a primary reference for systems programming, but rather as a guide to the fundamental programming concepts behind Unix systems. A good first book on the layout of Unix systems and basic tools and programming conventions is The Unix Programming Environment. While the Rochkind book is rather void in the direct humor sense, the historical context of the text is somewhat of a comedy within itself. When Rochkind introduces us to the popular flavors of Unix of the time, he points the reader to the following explanation for his coverage of a certain company's flavor:

Xenix, a product of Microsoft Corporation...Although Xenix is only one of many competing commercial systems, I've singled it out for special emphasis because it's the most popular microcomputer version, and--of paramount importance--it's supported by IBM on the Personal Computer AT. That almost guarantees that more computers will run Xenix 3 than will run all other versions {of Unix} combined.


My, how times have changed!

Rochkind's goal for the book is "to allow any experienced programmer to learn UNIX system calls as easily as I did, and then to use them wisely and portably."
Below is the table of contents.

Chapter 1 FUNDAMENTAL CONCEPTS
1.1 INTRODUCTION
1.2 FILES
1.2.1 Ordinary Files
1.2.2 Directories
1.2.3 Special Files
1.3 PROGRAMS AND PROCESSES
1.4 SIGNALS
1.5 PROCESS-IDS AND PROCESS GROUPS
1.6 PERMISSIONS
1.7 OTHER PROCESS ATTRIBUTES
1.8 INTERPROCESS COMMUNICATION
1.9 USING SYSTEM CALLS
1.10 PROGRAMMING CONVENTIONS
1.11 PORTABILITY

Chapter 2 BASIC FILE I/O
2.1 INTRODUCTION
2.2 FILE DESCRIPTORS
2.3 creat SYSTEM CALL
2.4 unlink SYSTEM CALL
2.5 IMPLEMENTING SEMAPHORES WITH FILES
2.6 open SYSTEM CALL
2.7 write SYSTEM CALL
2.8 read SYSTEM CALL
2.9 close SYSTEM CALL
2.10 BUFFERED I/O
2.11 lseek SYSTEM CALL
2.12 PORTABILITY

Chapter 3 ADVANCED FILE I/O
3.1 INTRODUCTION
3.2 I/O ON DIRECTORIES
3.3 I/O ON DISK SPECIAL FILES
3.4 DATES AND TIMES
3.5 FILE MODES
3.6 link SYSTEM CALL
3.7 access SYSTEM CALL
3.8 mknod SYSTEM CALL
3.9 chmod SYSTEM CALL
3.10 chown SYSTEM CALL
3.11 utime SYSTEM CALL
3.12 stat AND fstat SYSTEM CALLS
3.13 fcntl SYSTEM CALL
3.14 PORTABILITY

Chapter 3 TERMINAL I/O
4.1 INTRODUCTION
4.2 NORMAL TERMINAL I/O
4.3 NONBLOCKING TERMINAL I/O
4.4 ioctl SYSTEM CALL
4.4.1 Basic ioctl Usage
4.4.2 Speed, Character Size, and Parity
4.4.3 Character Mapping
4.4.4 Delays and Tabs
4.4.5 Flow Control
4.4.6 Control Characters
4.4.7 Echo
4.4.8 Punctual Input
4.5 RAW TERMINAL I/O
4.6 OTHER SPECIAL FILES
4.7 PORTABILITY

Chapter 5 PROCESSES
5.1 INTRODUCTION
5.2 ENVIRONMENT
5.3 exec SYSTEM CALLS
5.4 fork SYSTEM CALL
5.5 exit SYSTEM CALL
5.6 wait SYSTEM CALL
5.7 SYSTEM CALLS TO GET IDS
5.8 setuid AND setgid SYSTEM CALLS
5.9 setpgrp SYSTEM CALL
5.10 chdir SYSTEM CALL
5.11 chroot SYSTEM CALL
5.12 nice SYSTEM CALL
5.13 PORTABILITY

Chapter 6 BASIC INTERPROCESS COMMUNICATION
6.1 INTRODUCTION
6.2 pipe SYSTEM CALL
6.3 dup SYSTEM CALL
6.4 A REAL SHELL
6.5 BIDIRECTIONAL PIPES
6.6 PORTABILITY

Chapter 7 ADVANCED INTERPROCESS COMMUNICATION
7.1 INTRODUCTION
7.2 DATABASE MANAGEMENT SYSTEM ISSUES
7.3 FIFOS, OR NAMED PIPES
7.4 IMPLEMENTING MESSAGES WITH FIFOS
7.5 MESSAGE SYSTEM CALLS (SYSTEM V)
7.6 SEMAPHORES
7.6.1 Basic Semaphore Usage
7.6.2 Implementing Semaphores With Messages
7.6.3 Semaphores in System V
7.6.4 Semaphores in Xenix
7.7 SHARED MEMORY
7.7.1 Basic Shared Memory Usage
7.7.2 Shared Memory in System V
7.7.3 Shared Memory in Xenix
7.8 RECORD LOCKING IN XENIX
7.9 PORTABILITY

Chapter 8 SIGNALS
8.1 INTRODUCTION
8.2 TYPES OF SIGNALS
8.3 signal SYSTEM CALL
8.4 GLOBAL JUMPS
8.5 kill SYSTEM CALL
8.6 pause SYSTEM CALL
8.7 alarm SYSTEM CALL
8.8 PORTABILITY

Chapter 9 MISCELLANEOUS SYSTEM CALLS
9.1 INTRODUCTION
9.2 ulimit SYSTEM CALL
9.3 brk AND sbrk SYSTEM CALLS
9.4 umask SYSTEM CALL
9.5 ustat SYSTEM CALL
9.6 uname SYSTEM CALL
9.7 sync SYSTEM CALL
9.8 profil SYSTEM CALL
9.9 ptrace SYSTEM CALL
9.10 times SYSTEM CALL
9.11 time SYSTEM CALL
9.12 stime SYSTEM CALL
9.13 plock SYSTEM CALL (SYSTEM V)
9.14 mount SYSTEM CALL
9.15 umount SYSTEM CALL
9.16 acct SYSTEM CALL
9.17 sys3b SYSTEM CALL (SYSTEM V)
9.18 PORTABILITY

Appendix A SYSTEM V PROCESS ATTRIBUTES
Appendix B STANDARD SUBROUTINES

Happy hacking!

Log in or register to write something here or to contact authors.