Slashdot is powered by your submissions, so send in your scoop


Forgot your password?
Books Programming Book Reviews Linux

The Linux Programming Interface 73

Muad writes "Michael Kerrisk has been the maintainer of the Linux Man Pages collection (man 7) for more than five years now, and it is safe to say that he has contributed to the Linux documentation available in the online manual more than any other author before. For this reason he has been the recipient a few years back of a Linux Foundation fellowship meant to allow him to devote his full time to the furthering this endeavor. His book is entirely focused on the system interface and environment Linux (and, to some extent, any *NIX system) provides to a programmer. My most obvious choice for a comparison of the same caliber is Michael K. Johnson and Eric W. Troan's venerable Linux Application Development, the second edition of which was released in 2004 and is somewhat in need of a refresh, lamentably because it is an awesome book that belongs on any programmer's shelf. While Johnson and Troan have introduced a whole lot of programmers to the pleasure of coding to Linux's APIs, their approach is that of a nicely flowing tutorial, not necessarily complete, but unusually captivating and very suitable to academic use. Michael's book is a different kind of beast: while the older tome selects exquisite material, it is nowhere as complete as his — everything relating to the subject that I could reasonably think of is in the book, in a very thorough and maniacally complete yet enjoyably readable way — I did find one humorous exception, more on that later. Keep reading for the rest of Federico's review.
The Linux Programming Interface
author Michael Kerrisk
pages 1552
publisher No Starch Press
rating 8/10
reviewer Federico Lucifredi
ISBN 9781593272203
summary The definitive guide to the Linux and UNIX programming interface
This book is an unusual, if not altogether unique, entry into the Linux programming library: for one, it is a work of encyclopedic breadth and depth, spanning in great detail concepts usually spread in a multitude of medium-sized books, but by this yardstick the book is actually rather concise, as it is neatly segmented in 64 nearly self-contained chapters that work very nicely as short, deep-dive technical guides. I have collected an extremely complete technical library over the years, and pretty much any book of significance that came out of the Linux and Bell Labs communities is in it — it is about 4 shelves, and it is far from portable. It is very nice to be able to reach out and pick the definitive work on IPC, POSIX threads, or one of several socket programming guides — not least because having read them, I know what and where to pick from them. But for those out there who have not invested so much time, money, and sweat moving so many books around, Kerrisk's work is priceless: any subject be it timers, UNIX signals, memory allocation or the most classical of topics (file I/O) gets its deserved 15-30 page treatment, and you can pick just what you need, in any order.

Weighing in at 1552 pages, this book is second only to Charles Kozierok's mighty TCP/IP Guide in length in the No Starch Press catalog. Anyone who has heard me comment about books knows I usually look askance at anything beyond the 500-page mark, regarding it as something defective in structure that fails the "I have no time to read all that" test. In the case of Kerrisk's work, however, just as in the case of Kozierok's, actually, I am happy to waive my own rule, as these heavyweights in the publisher's catalog are really encyclopedias, and despite my bigger library I will like to keep this single tome within easy reach of my desk to avoid having to fetch the other tomes for quick lookups — yes, I still have lazy programmer blood in my veins.

There is another perspective to this: while writing, I took a break and while wandering around I found myself in Miguel's office (don't tell him ;-), and there spotted a Bell Labs book lying on his shelf that (incredibly) I have never heard of. After a quick visit to AbeBooks to take care of this embarrassing matter, I am back here writing to use this incident as a valuable example: the classic system programming books, albeit timeless in their own way, show their rust when it comes to newer and more esoteric Linux system calls (mmap and inotify are fair examples) and even entire subsystems in some cases — and that's another place where this book shines: it is not only very complete, it is really up to date, a combination I cannot think of a credible alternative to in today's available book offerings.

One more specialized but particularly unique property of this book is that it can be quite helpful in navigating what belongs to what standard, be it POSIX, X/Open, SUS, LSB, FHS, and what not. Perhaps it is not entirely complete in this, but it is more helpful than anything else I have seen released since Donald Lewine's ancient POSIX Programmers Guide (O'Reilly). Standards conformance is a painful topic, but one you inevitably stumble into when writing code meant to compile and run not only on Linux but to cross over to the BSDs or farther yet to other *NIX variants. If you have to deal with that kind of divine punishment, this book, together with the Glibc documentation, is a helpful palliative as it will let you know what is not available on other platforms, and sometimes even what alternatives you may have, for example, on the BSDs.

If you are considering the purchase, head over to Amazon and check out the table of contents, you will be impressed. The Linux Programming Encyclopedia would have been a perfectly adequate title for it in my opinion. In closing, I mentioned that after thinking for a good while I found one thing to be missing in this book: next to the appendixes on tracing, casting the null pointer, parsing command-line options, and building a kernel configuration, a tutorial on writing man pages was sorely and direly missing! Michael, what were you thinking?

Federico Lucifredi is the maintainer of man (1) and a Product Manager for the SUSE Linux Enterprise and openSUSE distributions.

You can purchase The Linux Programming Interface from Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.


This discussion has been archived. No new comments can be posted.

The Linux Programming Interface

Comments Filter:
  • by Anonymous Coward on Monday November 08, 2010 @03:05PM (#34164266)
    Man pages are written in [ng]roff format, so no, they're not just text files.
  • by trb ( 8509 ) on Monday November 08, 2010 @03:38PM (#34164730)
    Man pages are plain text files, but not just text files. They are also not just ?roff files. They are written using the "man page macros" for [gnt]roff. These man page macros were written for UNIX in the 1970's, and survive pretty much unchanged. You can find doc for them on your Linux system by typing: man 7 man or []

    If Kerrisk is the keeper of man 7, and he was supposed to cover man 7 in his book, then yes, this would be an oversight.

    The ?roff language was pretty much "assembler language" for typesetting - you weren't supposed to write your documents in raw ?roff. In those days, before word processors like msword and oo, and before TeX and LaTeX, anyone who wrote docs for UNIX systems was well versed in the different macro packages, including some of man, ms, mm, me, and others.

  • by noidentity ( 188756 ) on Monday November 08, 2010 @03:52PM (#34164932)

    They're actually bits, not strings. I will spare myself the task of explaining further.

    Good, because it wouldn't be necessary. On the other hand, in an informal sense, a string is "A linear sequence of characters, words, or other data" (from Google dictionary). In this case, it's a linear sequence of bits. The bits aren't characters (unless your machine's characters are a single bit wide), but I think string was appropriate. I could have called them a one-dimensional vector, or a linear sequence of bits, but I guess I didn't think of you when writing the post.

  • by Tetsujin ( 103070 ) on Monday November 08, 2010 @03:57PM (#34164992) Homepage Journal


    Sorry , but no other book comes close to Advanced Programming in the Unix Enviroment.

    You know, I was thinking more or less the same thing when I read this story. How can a review like this not make the obvious comparison with the glorious APUE? I love that book. I have to admit, I didn't even know you could pass file descriptors from one process to another before I read it... And its descriptions of job control, TTYs, process hierarchies and so on have been very valuable to me.

    It seems like this book covers a lot of the same ground, though presumably without the same level of cross-platform coverage. Though I don't think APUE covered xattrs (can't remember offhand)... I had hoped that this book, being more Linux-specific, would cover more of the stuff that's more current and fairly specific to current Linux distros: FUSE, dbus, the current state and direction of kernel drivers for graphics and sound, any Linux-specific process jail or virtual machine mechanisms, and so on...

    Still, I'd really like to browse through this book. If there's enough useful information that doesn't overlap APUE it might be worth getting. Maybe my local bookstore will get a copy sometime...

  • by jgrahn ( 181062 ) on Monday November 08, 2010 @05:36PM (#34166574)

    True, Stevens is still the gold standard. However, since he died over a decade ago you're never going to get a description of newer APIs (epoll, dnotify, ...)

    For epoll, it would be enough with a "see also: epoll(7)" in select(2). And now I see there *is* such a reference.

    epoll is nice: one of the few Linux-specific system interfaces which is clearly better than the standard Unix counterpart (select/poll).

  • by StuartHankins ( 1020819 ) on Monday November 08, 2010 @06:09PM (#34167022)
    I went to Amazon earlier and found the same thing. I was pretty sure it was a typo since the book just came out in October 2010, so I clicked their "call me". An automated system called me, but in the process of transferring me to a rep it hung up on me. So I tried their "chat" feature. The rep took about 10 minutes and finally came back and said the same thing as the website, 2 to 6 months.

    The publisher supposedly has the book in stock, as well as other stores such as, but it ranges from slightly more expensive to 33% more expensive ($100 vs $63 is a big difference to me).
  • by mkerrisk ( 1937026 ) on Tuesday November 09, 2010 @02:11AM (#34170630) Homepage
    For more information about the book, including a detailed table of contents, index, preface, and sample chapters, see my website for the book at [].

"Remember, extremism in the nondefense of moderation is not a virtue." -- Peter Neumann, about usenet