Review: Linux Application Development, Second Edition
So it was a pleasant surprise to see a new edition of LAD show up in the mail. This core text, it turns out, has not gone out of maintenance after all.
According to the preface:
As of this writing, the web site has not caught up with that claim - it still discusses the first edition (and with no "entire content") to browse. One assumes that situation will be rectified in time. If the book is being released under some sort of free license, however, that is not stated explicitly.
The structure and content of the book has not changed all that much from the first edition: LAD still concerns itself with low-level Linux programming, system calls, and some C libraries. The updates are to be found in the details: the text now matches, for the most part, the interfaces provided by the 2.6 kernel and glibc 2.3. Some new interfaces (such as epoll()) have been covered, and there is a new chapter on security pitfalls and how to avoid them. The discussion of the socket interface covers IPv6, the regular expression discussion has been expanded, real-time signals are covered, etc.
With these changes, LAD is, once again, the definitive reference for the low-level Linux C API. Whether you need to learn about memory allocation debugging facilities, the details of process management, file descriptor magic, or more, you're likely to find what you need in this book. Much of that information is also available in generic Unix texts; the difference is that LAD looks at exactly what Linux offers. While Linux follows the relevant standards to a great degree, there are many places where Linux diverges from the standards or offers extra capabilities. A reference book which documents the Linux way of doing things is a good thing.
That said, your editor does have some quibbles with the second edition. One is that the update appears, in many places, to have been done in a hurry. The LGPL is called the "Library General Public License" - but it has not had that name for quite a few years now. The recommended system administration book is Sobel's A Practical Guide to Red Hat Linux 8. The (new) documentation of strace claims that it writes to the standard output, which is not true (it writes to stderr). Passwords, it claims, are usually stored in /etc/passwd. Many flags to the clone() system call are missing; a number of mmap() flags are absent as well. Your editor may have been willing to forgive all of this if the authors, while being nice enough to mention Linux Device Drivers, had noticed that a new edition has come out since 1998.
Perhaps more to the point, however, LAD may be falling behind the way that applications are being developed for Linux. Your editor has certainly done his time writing ioctl() calls to control TTY parameters - but not recently. The chapters on virtual consoles and S-Lang seem rather quaint. While a great deal of Linux software is still developed in C, quite a bit is not. After reading LAD, one might almost conclude that graphical applications simply do not exist under Linux. The authors clearly had to limit their scope, and they cannot be faulted for failing to document, say, the GNOME and KDE libraries. But the second edition could have been an ideal vehicle for pointing developers toward the sorts of tools being used for new code, and away from writing TTY-oriented applications.
That said, application developers still need to understand how to manage
memory, create processes, handle signals, work with files, etc. The second
edition of Linux Application Development fills that need and more;
it is a most welcome update. It will, beyond doubt, find a location very
near the keyboards of a great many Linux application hackers.