John Goerzen > Publications > Linux Programming Bible > Errata

Errata for Linux Programming Bible

While the Linux Programming Bible went through an extensive review process prior to publication, due to the sheer size of this book, some errors inevitably slip through. These errors will be noted here as they are discovered.

ChapterLocationDescription
2 Page 34 In several places, > is used instead of >>. The third line of text on the page should read: "Then, the >> operator is used..." The second line of the first example should read "$ ls -l /dev/hda[2-9] >> listing". The first line of the second example should have " /dev/foo >> listing". Thanks to Jaimie C. Thomas for this report.
3 pattest line 30, page 78 The code "($#MATCHES) + 1" should read "($#MATCHES + 1)". The fix has been made to the lpb-examples tar file. Thanks to Richard Rasker for this report.
7 Pages 203, 206; Listings 7-2 and 7-3 There is a 2-line comment in these listings that begins with "Specify that all .o files depend". This comment is misleading and should be ignored. Reported by Sergiy Zhenochin.
7   In several listings and examples in this chapter, the string ">>" appeared at ">" in the printed book. In the downloadable examples file, the code is correct. Reported by Osamu Aoki and John Dillick.
14 Title of listing 14-2 This listing refers to system call, not stream, I/O.
14   Some examples in this chapter did not include string.h, which may cause harmless compilation warnings on some systems. The examples available for download have been corrected.
15 Compilation instructions after Listing 15-2 To compile this program, you must use the following command. The text omitted the safecalls.c reference. The command is: gcc -Wall -o myscript myscript.c safecalls.c -lutil
17   Some examples in this chapter did not include string.h, which may cause harmless compilation warnings on some systems. The examples available for download have been corrected.
18   The heading for listing 18-6 is wrong; it should read: "Revised network server code"
18 Listings 18-2, 18-3, and 18-6 Each of these listings contained a call to accept(2). The third argument to accept, a pointer to an integer (addrlen in these examples), is both an input and an output variable to the function. It should be initialized to the size of the second parameter in bytes (struct sockaddr_in for these examples), and is set to the number of bytes actually used when accept() returns. However, this initialization was not done in the code. The code appears to function anyway in most cases, but should be corrected. It has been fixed in the LPB Examples file as of August 2, 2001. Thanks to Bjorn Dittmer-Roche for finding this bug.

Please see also the Linux Programming Bible homepage.