W. Richard Stevens39 books85 followersFollowFollow · Goodreads

June 23, 2024

This book is about writing programs in C that interact with typical kernel interfaces in UNIX systems. The book considers the POSIX standard, along with some further standards like the Single UNIX Specification (SUS). The interfaces described and the code written here is tested to work with certain releases of OpenBSD, Linux, MacOS, and Solaris. Overall the approach is practical, not academical: Occasionally you'll find some empirical benchmarking being run on the four mentioned systems to figure out the efficiency of certain approaches.

As should be clear from the title, this book is not about writing contributions to the kernel code of a UNIX-like system, it's about writing programs that run in the user space UNIXoid operating systems. After the basics of file systems and file access have been dealt with, the book moves on to introduce the different types of communications between threads, processes and machines, like pipes, streams, sockets, shared memory. What is commonly associated with advanced topics in this context, is given due space here: Multithreading, inter-process communication, mutual exclusion without deadlocking.

After having dealt with all of its topics on a rather microscopic level with only small examples, the book is rounded off with two chapters, where larger sections of code are reproduced with extensive commentary. Those two examples are well chosen: First we see the implementation of a simple key-value database system, where efficiency is tried to be achieved by using byte-range locking (i. e. locking of only portions of a file, rather than locking entire files, to allow concurrent write access to different portions of a database file). The second example is showing the implementation of a print spooling process, thereby elaborating on daemon processes and network communication.

Some familiarity with C is necessary to make use of this book, though it needn't be on expert level.


Read the original on goodreads.com ↗