The Linux Programming Interface Book Review
The expanding role of Linux in our lives is undeniable. From the servers that run our favorite websites to the smartphones that keep us on the grid, Linux continues to make a major impact in the way we connect, transfer and manipulate electronic data. However, few books have plumbed the depths of the heart of the Linux OS. Does this latest attempt by author and Linux hacker Michael Kerrisk satiate this market need? Read on to find out.Coming in at just over 1,500 pages, The Linux Programming Interface (TLPI)reminds me of the Linux version of Charles Petzold's Programming Windows in terms of size, scope and depth. Unlike Programming Windows, with the last published edition nearly 12 years old, TLPI is hot off the presses and intended for today's generation of computer software students and engineers. It also serves as a reminder of how this rapidly evolved OS is based on nearly 40 year old OS design principles and languages. Knowing the C language is an obvious prerequisite to extract meaningful information from the book, as well as a desire to learn the inner workings of the Linux kernel.
The book begins with a brief history on the development of Unix and Linux and the standards they employ, followed by a chapter on fundamental concepts (i.e., a breakdown of the kernel which serves as an outline of the chapters to follow). System programming concepts (getting familiar with glib) is followed by two chapters on File I/O. Processes, Memory allocation, users and groups, process credentials and time round out the first 10 chapters. System limits, process information, File I/O buffering, file systems and attributes (and extended attributes), access control lists (ACLs), directories and links and monitoring file events are also explored. Several chapters on signals (fundamentals, handlers, advanced features), timers and sleeping, processes (creation, termination, monitoring), program execution and threads (synchronization, safety, cancellation and more). The book continues with explanations of process groups, sessions, job control, priorities, scheduling and managing process resources. Chapters on Daemons, privileged programs, file and system capabilities, login accounting (the utmpx API), shared libraries, interprocess communication (IPC), pipes and FIFOs are then followed by several chapters on System V and topics (IPC APIs, message queues, semaphores, shared memory). More chapters on follow on file locking, sockets (struct sockaddr_un and socketpair(), TCP/IP fundamentals, internet domains, TCP and UDP echo server designs and advanced topics such as the netstat, tcpdump, snedmsg() and recvmsg() system calls), terminals and alternative I/O models (multiplexing, signal-driven, the epos API, and the pselect() system call for example). The book concludes its 64th chapter on UNIX 98 and BSD pseudoterminals. Six brief appendixes cover the strace system trace command, command-line parching, null pointer casting, kernel configuration, additional references and solutions to selected exercises posed at the end of each chapter.
Before No Starch's TLPI came along, I had been recommending Wolfgang Mauerer's Professional Kernel Architecture, published two years ago by Wrox. TLPI benefits from having the latest Linux kernel to base its discussions on, as well as the 20+ years of UNIX development and teaching experience as well as the Linux kernel man-pages contributions that the author brings to the text. Still, the nearly one hundred dollar cover price will be a persistent barrier of entry for all but the most devoted students and developers of Linux kernel knowledge. There is no doubt after consuming TLPI that readers will be vastly more knowledgeable about the complexity underlying the Linux kernel, though for those merely interested so they can understand why and how certain popular system calls work the way they do, the Wrox title still holds a place on the bookshelf and is much easier on the wallet.
Good news, everyone! Just as I was going to post this review, the No Starch folks have informed me that the electronic edition of TLPI is forthcoming and will be fifty dollars less than the hardcover print version. Of course, for those not yet equipped with a purpose-built electronic reading device or still prefer the physical ink on paper approach, No Starch is also offering a free version of the Ebook with the purchase of the hardcover edition from their online store.