| help | account  


Linux Programming by Example: The Fundamentals
View Larger Image
Arnold Robbins
Prentice Hall, Paperback, Published April 2004, 687 pages, ISBN 0131429647
List Price: $43.99
Our Price: $27.95
You Save: $16.04 (36% Off)


FREE Shipping on Orders over $40!*
Availability: Out-Of-Stock

Be the First to Write a Review and tell the world about this title!

People who purchase this book frequently purchase:

Books on similar topics, in best-seller order:Books from the same publisher, in best-seller order:

This 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.



Features

  • Expert coverage of core Linux APIs—Covers fundamental Linux system calls and standard functions, including I/O, file meta-information, users/groups, processes, pipes, general purpose APIs, signals, internationalization, and more.
    • Prepares students for a wide range of Linux programming challenges, while providing a firm foundation they can build upon for many years to come.

  • Example-focused presentation—Teaches Linux programming through the use of familiar examples, including Unix source code and GNU utilities.
    • Helps students understand how the best Linux and Unix programmers have solved a wide range of critical challenges.

  • Practical guidance on reading Linux/Unix programs—Teaches students how to read and learn from the source code of any Linux/Unix program.
    • Helps students gain insights from any Linux/Unix program, not just the ones in this book.

  • Debugging coverage—Demonstrates how to effectively debug Linux/Unix programs—and how to write programs that are easier to debug.
    • Helps students identify, resolve, and avoid problems in their code, so they can write more robust and reliable programs.

  • Incremental, step-by-step approach—Covers Linux/Unix APIs in an incremental, consistent fashion, progressing gradually from basic to more complex.
    • Helps students build knowledge and confidence gradually, one step at a time.

  • Standards-based examples—Focuses on ANSI/ISO C, POSIX, common extensions, and GNU/Linux standards, and tells students where each code sample comes from and where it can be used.
    • Teaches students portable, standards-based techniques they can use in a wide range of programming environments.

  • Focused coverage—Focuses on the Linux/Unix APIs that are most valuable in day-to-day work, and avoids arcane and rarely used APIs.
    • Helps students make the most of their time.

  • Downloadable code examples—All code examples may be downloaded from the books companion Web site, and are widely available elsewhere on the Internet.
    • Gives students access to all the examples they need to gain a deep mastery of Linux programming.

 


Table of Contents


Preface.

Audience. What You Will Learn. Small Is Beautiful: Unix Programs. Standards. Features and Power: GNU Programs. Summary. Typographical Conventions. Where To Get Unix and GNU Source Code. Unix Code. GNU Code.



Acknowledgments.


1. Introduction.

The Linux/Unix File Model. The Linux/Unix Process Model. Standard C vs Original C. Why GNU Programs Are Better. Portability Revisited. Suggested Reading. Summary. Exercises.



2. Arguments, Options, and the Environment.

Option and Argument Conventions. Basic Command Line Processing. Option Parsing: getopt() and getopt_long(). The Environment. Summary. Exercises.



3. User-Level Memory Management.

Linux/Unix Address Space. Allocating Memory. Summary. Exercises.



4. Files and File I/O.

Introduction. Basic Program Structure. Determining What Went Wrong. Input and Output. Random Access: Moving Around Within A File. Creating Files. Forcing Data to Disk. Setting File Length. Summary. Exercises.



5. Directories and File Metadata.

Directory Contents. Creating and Removing Directories. Reading Directories. File Types and Information. Changing Ownership, Permission, and Modification Times. Summary. Exercises.



6. General Library Interfaces - Part 1.

Times and Dates. Sorting and Searching. User and Group Names. Terminals: isatty(). Suggested Reading. Summary. Exercises.



7. Putting It All Together: ls.

V7 ls Options. The V7 ls Code. Summary. Exercises.



8. Filesystems and Directory Walks.

Mounting and Unmounting Filesystems. Filesystem Administration Files. Retrieving Per-filesystem Information. Moving Around In The File Hierarchy. Doing A File Tree Walk: GNU du. Changing The Root Directory: chroot(). Summary. Exercises.



9. Process Management and Pipes.

Process Creation and Management. Process Groups. Basic Interprocess Communication: Pipes and FIFOs. File Descriptor Management. Example: Two Way Pipes In gawk. Suggested Reading. Summary. Exercises.



10. Signals.

Introduction. Signal Actions. Standard C Signals: signal() and raise(). Signal Handlers In Action. The System V Release 3 Signal APIs: sigset() et al. POSIX Signals. Signals For Interprocess Communication. Important Special Purpose Signals. Signals Across fork() and exec(). Summary. Exercises.



11. User and Group ID Numbers and Permissions.

Introduction. Retrieving User and Group IDs. Checking As The Real User: access(). GLIBC Only: Checking As The E_ective User: euidaccess(). Extra Permission Bits For Directories. Setting Real and E_ective IDs. Linux Only: getresuid() and setresuid(). Setuid root: A Security Minefield. Suggested Reading. Summary. Exercises.



12. General Library Interfaces - Part 2.

Stating Assertions: assert(). Low-level Memory: The memXXX() Functions. Temporary Files. Committing Suicide: abort(). Non-local Gotos. Pseudorandom Numbers. Metacharacter Expansions. Regular Expressions. Suggested Reading. Summary. Exercises.



13. Internationalization and Localization.

Locales and the C Library. Dynamic Translation of Program Messages. Can You Spell That For Me Please? Suggested Reading. Summary. Exercises.



14. Extended Interfaces.

Allocating Aligned Memory: posix_memalign() and memalign(). Locking Files. More Precise Times. Advanced Searching With Binary Trees. Summary. Exercises.



15. Debugging.

What To Do First? Compiling For Debugging. GDB Basics. Programming For Debugging. Debugging Tools. Software Testing. Debugging Rules. Suggested Reading. Summary. Exercises.



16. Tying It Together - A Project.

Project Description. Suggested Reading.



Appendix A: Teach Yourself Programming in Ten Years.

Why is everyone in such a rush? Teach Yourself Programming in Ten Years. References. Answers. Footnotes.



Appendix B: Caldera Ancient UNIX License.


Appendix C: GNU General Public License.


Preamble.


Terms and Conditions for Copying, Distribution and Modification.


How to Apply These Terms to Your New Programs.


Example Use.


Index.

 


About the Author

ARNOLD ROBBINS is a professional programmer and instructor, and author of UNIX in a Nutshell, Learning the Korn Shell, and Effective awk Programming. A long-time GNU Project volunteer, he currently maintains gawk. He has worked with C, C++, Unix, and GNU/Linux since 1980.






Forgot your password?
FAQs
Shipping Options
Returns
Your Orders
Your Account