Advanced Linux Programming
By Mark Mitchell, Jeffrey Oldham, Alex Samuel
Part 0
Copyright
About the Authors
About the Technical Reviewers
Acknowledgments
Tell Us What You Think
Introduction
GNU and Linux
The GNU General Public License
Who Should Read This Book?
Conventions
Part I: Advanced UNIX Programming with Linux
Chapter 1. Getting Started
Editing with Emacs
Compiling with GCC
Automating the Process with GNU Make
Debugging with GNU Debugger
Finding more Information
Chapter 2. Writing Good GNU/Linux Software
Interaction With the Execution Environment
Coding Defensively
Writing and Using Libraries
Chapter 3. Processes
Looking at Processes
Creating Processes
Signals
Process Termination
Chapter 4. Threads
Thread Creation
Thread Cancellation
Thread-Specific Data
Synchronization and Critical Sections
GNU/Linux Thread Implementation
Processes Vs. Threads
Chapter 5. Interprocess Communication
Shared Memory
Processes Semaphores
Mapped Memory
Pipes
Sockets
Part II: Mastering Linux
Chapter 6. Devices
Device Types
Device Numbers
Device Entries
Hardware Devices
Special Devices
PTYs
ioctl
Chapter 7. The /proc File System
Extracting Information from /proc
Process Entries
Hardware Information
Kernel Information
Drives, Mounts, and File Systems
System Statistics
Chapter 8. Linux System Calls
Using strace
access: Testing File Permissions
fcntl: Locks and Other File Operations
fsync and fdatasync: Flushing Disk Buffers
getrlimit and setrlimit: Resource Limits
getrusage: Process Statistics
gettimeofday: Wall-Clock Time
The mlock Family: Locking Physical Memory
mprotect: Setting Memory Permissions
nanosleep: High-Precision Sleeping
readlink: Reading Symbolic Links
sendfile: Fast Data Transfers
setitimer: Setting Interval Timers
sysinfo: Obtaining System Statistics
uname
Chapter 9. Inline Assembly Code
When to Use Assembly Code
Simple Inline Assembly
Extended Assembly Syntax
Example
Optimization Issues
Maintenance and Portability Issues
Chapter 10. Security
Users and Groups
Process User IDs and Process Group IDs
File System Permissions
Real and Effective IDs
Authenticating Users
More Security Holes
Chapter 11. A Sample GNU/Linux Application
Overview
Implementation
Modules
Using the Server
Finishing Up
Part III: Appendixes
Appendix A. Other Development Tools
Static Program Analysis
Finding Dynamic Memory Errors
Profiling
Appendix B. Low-Level I/O
Reading and Writing Data
stat
Vector Reads and Writes
Relation to Standard C Library I/O Functions
Other File Operations
Reading Directory Contents
Appendix C. Table of Signals
Appendix D. Online Resources
General Information
Information About GNU/Linux Software
Other Sites
Appendix E. Open Publication License Version 1.0
I. Requirements on Both Unmodified and Modified Versions
II. Copyright
III. Scope of License
IV. Requirements on Modified Works
V. Good-Practice Recommendations
VI. License Options
Open Publication Policy Appendix
Appendix F. GNU General Public License
Preamble
Terms and Conditions for Copying, Distribution and Modification
End of Terms and Conditions