Home > Store > Operating Systems, Server
Linux Programming by Example: The Fundamentals
- By Arnold Robbins
- Published Apr 12, 2004 by Prentice Hall. Part of the Prentice Hall Open Source Software Development Series series.
- Copyright 2004
- Dimensions: 7x9-1/4
- Pages: 720
- Edition: 1st
- Book
- ISBN-10: 0-13-142964-7
- ISBN-13: 978-0-13-142964-2
Register your product to gain access to bonus material or receive a coupon.
“This is an excellent introduction to Linux programming. The topics are well chosen and lucidly presented. I learned things myself, especially about internationalization, and I’ve been at this for quite a while.”
Chet Ramey, Coauthor and Maintainer of the Bash shell
“This is a good introduction to Linux programming. Arnold’s technique of showing how experienced programmers use the Linux programming interfaces is a nice touch, much more useful than the canned programming examples found in most books.”
Ulrich Drepper, Project Lead, GNU C library
“A gentle yet thorough introduction to the art of UNIX system programming, Linux Programming by Example uses code from a wide range of familiar programs to illustrate each concept it teaches. Readers will enjoy an interesting mix of in-depth API descriptions and portability guidelines, and will come away well prepared to begin reading and writing systems applications. Heartily recommended.”
Jim Meyering, Coauthor and Maintainer of the GNU Core Utility Programs
Learn Linux® programming, hands-on… from real source codeThis book teaches Linux programming in the most effective way possible: by showing and explaining well-written programs. Drawing from both V7 Unix® and current GNU source code, Arnold Robbins focuses on the fundamental system call APIs at the core of any significant program, presenting examples from programs that Linux/Unix users already use every day. Gradually, one step at a time, Robbins teaches both high-level principles and “under the hood” techniques. Along the way, he carefully addresses real-world issues like performance, portability, and robustness. Coverage includes:
- Memory management
- File I/O
- File metadata
- Processes
- Users and groups
- Sorting and searching
- Argument parsing
- Extended interfaces
- Signals
- Internationalization
- Debugging
- And more…
Just learning to program? Switching from Windows®? Already developing with Linux but interested in exploring the system call interface further? No matter which, quickly and directly, this book will help you master the fundamentals needed to build serious Linux software.
Companion Web Sites, authors.phptr.com/robbins and www.linux-by-example.com, include all code examples.
Links
To facilitate your work with the "Suggested Reading" sections of the text, we are providing links to select books and online resources referenced throughout the book.
From Chapter 1
- The C Programming Language, 2nd edition , by Brian W. Kernighan and Dennis M. Ritchie. Prentice-Hall, Englewood Cliffs, New Jersey, USA, 1989. ISBN: 0-13-110370-9. This is the "bible" for C, covering the 1990 version of Standard C. It is a rather dense book, with lots of information packed into a startlingly small number of pages. You may need to read it through more than once; doing so is well worth the trouble.
- C, A Reference Manual, 5th edition, by Samuel P. Harbison III and Guy L. Steele, Jr. Prentice-Hall, Upper Saddle River, New Jersey, USA, 2002. ISBN: 0-13-089592-X. This book is also a classic. It covers Original C as well as the 1990 and 1999 standards. Because it is current, it makes a valuable companion to The C Programming Language. It covers many important items, such as internationalization- related types and library functions, that aren't in the Kernighan and Ritchie book.
- Notes on Programming in C , by Rob Pike, February 21, 1989. Available on the Web from many sites. Perhaps the most widely cited location is http://www.lysator.liu.se/c/pikestyle.html . (Many other useful articles are available from one level up: http://www.lysator.liu.se/c/ .) Rob Pike worked for many years at the Bell Labs research center where C and Unix were invented and did pioneering development there. His notes distill many years of experience into a "philosophy of clarity in programming" that is well worth reading.
- The various links at http://www.chris-lott.org/resources/cstyle/ . This site includes Rob Pike's notes and several articles by Henry Spencer. Of particular note is the Recommended C Style and Coding Standards, originally written at the Bell Labs Indian Hill site.
From Chapter 6
- The Art of Computer Programming Volume 3: Sorting and Searching, 2nd edition , by Donald E. Knuth. Addison-Wesley, Reading Massachusetts, USA, 1998. ISBN: 0-201-89685-0. This book is usually cited as the final word on sorting and searching. Bear in mind that it is considerably denser and harder to read than the Loudon book.
- The GTK+ project consists of several libraries that work together. GTK+ is the underlying toolkit used by the GNU GNOME Project . At the base of the library hierarchy is Glib, a library of fundamental types and data structures and functions for working with them. Glib includes facilities for all the basic operations we've covered so far in this book, and many more, including linked lists and hash tables. To see the online documentation, start at the GTK+ Documentation Project's web site , click on the "Download" link, and proceed to the online version.
From Chapter 9
- Advanced Programming in the UNIX Environment, 2nd edition , by W. Richard Stevens and Stephen Rago. Addison-Wesley, Reading Massachusetts, USA, 2004. ISBN: 0-201-43307-9. This book is both complete and thorough, covering elementary and advanced Unix programming. It does an excellent job of covering process groups, sessions, job control, and signals.
- The Design and Implementation of the 4.4 BSD Operating System , by Marshall Kirk McKusick, Keith Bostic, Michael J. Karels, and John S. Quarterman. Addison-Wesley, Reading, Massachusetts, USA, 1996. ISBN: 0-201-54979-4. This book gives a good overview of the same material, including a discussion of kernel data structures, which can be found in section 4.8 of that book.
From Chapter 11
- Building Secure Software: How to Avoid Security Problems the Right Way , by John Viega and Gary McGraw. Addison-Wesley, Reading, Massachusetts, USA, 2001. ISBN: 0-201-72152-X. This is a good book on writing secure software and it includes how to deal with setuid issues. It assumes you are familiar with the basic Linux/Unix APIs; by the time you finish reading our book, you should be ready to read it.
- "Setuid Demystified," by Hao Chen, David Wagner, and Drew Dean. Proceedings of the 11th USENIX Security Symposium, August 5-9, 2002. http://www.cs.berkeley.edu/~daw/papers/setuid-usenix02.pdf . Garfinkel, Spafford, and Schwartz recommend reading this paper "before you even think about writing code that tries to save and restore privileges." We most heartily agree with them.
From Chapter 12
- Programming Pearls, 2nd edition , by Jon Louis Bentley. Addison-Wesley, Reading, Massachusetts, USA, 2000. ISBN: 0-201-65788-0. See also this book's web site at http://www.cs.bell-labs.com/cm/cs/pearls/ . Program design with assertions is one of the fundamental themes in the book.
- Building Secure Software: How to Avoid Security Problems the Right Way , by John Viega and Gary McGraw. Addison-Wesley, Reading, Massachusetts, USA, 2001. ISBN: 0-201-72152-X. Race conditions are only one of many issues to worry about when you are writing secure software. Random numbers are another. This book covers both, among other things. (We mentioned it in the Chapter 11.)
- The Art of Computer Programming: Volume 2: Seminumerical Algorithms, 3rd edition , by Donald E. Knuth. Addison-Wesley, Reading, Massachusetts, USA, 1998. ISBN: 0-201-89684-2. See also the book's web site at http://www-cs-faculty.stanford.edu/~knuth/taocp.html . This is the classic reference on random number generation.
From Chapter 13
- C: A Reference Manual, 5th edition , by Samuel P. Harbison III and Guy L. Steele, Jr., Prentice-Hall, Upper Saddle River, New Jersey, USA, 2002. ISBN: 0-13-089592-X. We have mentioned this book before. It provides a concise and comprehensible description of the evolution and use of the multibyte and wide-character facilities in the C standard library. This is particularly valuable on modern systems supporting C99 because the library was significantly enhanced for the 1999 C standard.
- GNU gettext tools, by Ulrich Drepper, Jim Meyering, Francois Pinard, and Bruno Haible. This is the manual for GNU gettext. On a GNU/Linux system, you can see the local copy with 'info gettext'. Or download and print the latest version (from ftp://ftp.gnu.org/gnu/gettext/ ).
From Chapter 15
- Programming Pearls, 2nd edition , by Jon Louis Bentley. Addison-Wesley, Reading, Massachusetts, USA, 2000. ISBN: 0-201-65788-0. See also this book's web site at http://www.cs.bell-labs.com/cm/cs/pearls/ . Chapter 5 of this book gives a good discussion of unit testing and building test scaffolding.
- The Practice of Programming , by Brian W. Kernighan and Rob Pike. Addison- Wesley, Reading, Massachusetts, USA, 1999. ISBN: 0-201-61585-X.
From Chapter 16
- The UNIX Programming Environment , by Brian W. Kernighan and Rob Pike. Prentice-Hall, Englewood Cliffs, New Jersey, USA, 1984. ISBN: 0-13-937699-2. This is the classic book on Unix programming, describing the entire gestalt of the Unix environment, from interactive use, to shell programming, to programming with the <stdio.h> functions and the lower-level system calls, to program development with make, yacc, and lex, and documentation with nroff and troff. Although the book shows its age, it is still eminently worth reading, and we highly recommend it.
- The Art of UNIX Programming , by Eric S. Raymond. Addison-Wesley, Reading, Massachusetts, USA, 2004. ISBN: 0-13-142901-9. This is a higher-level book that focuses on the design issues in Unix programming: how Unix programs work and how to design your own programs to fit comfortably into a Linux/Unix environment. While we don't always agree with much of what the author has to say, the book does have considerable important material and is worth reading.