Foreword
Preface
1. Introduction and Essential Concepts
System Programming
APIs and ABIs
Standards
Concepts of Linux Programming
Getting Started with Syster~ Programming
2. File I/O
Opening Files
Reading via read( )
Writing with write( )
Synchronized I/O
Direct I/O
Closing Files
Seeking with lseek( )
Positional Reads and Writes
Truncating Files
Multiplexed I/O
Kernel Internals
Conclusion
3. Buffered I/0
User-Buffered I/0
Standard I/0
Opening Files
Opening a Stream via File Descriptor
Closing Streams
Reading from a Stream
Writing to a Stream
Sample Program Using Buffered I/0
Seeking a Stream
Flushing a Stream
Errors and End-of-File
Obtaining the Associated File Descriptor
Controlling the Buffering
Thread Safety
Critiques of Standard I/0
Conclusion
4. Advanced File I/0
Scatter/Gather I/O
The Event Poll Interface
Mapping Files into Memory
Advice for Normal File I/O
Synchronized, Synchronous, and Asynchronous Operations
I/O Schedulers and I/O Performance
Conclusion
5. Process Management
The Process ID
Running a New Process
Terminating a Process
Waiting for Terminated Child Processes
Users and Groups
Sessions and Process Groups
Daemons
Conclusion
6. Advanced Process Management
Process Scheduling
Yielding the Processor
Process Priorities
Processor Affinity
Real-Time Systems
Resource Limits
7. Fileand Directory Management
Files and Their Metadata
Directories
Links
Copying and Moving Files
Device Nodes
Out-of-Band Communication
Monitoring File Events
8. Memory Management
The Process Address Space
Allocating Dynamic Memory
Managing the Data Segment
Anonymous Memory Mappings
Advanced Memory Allocation
Debugging Memory Allocations
Stack-Based Allocations
Choosing a Memory Allocation Mechanism
Manipulating Memory
Locking Memory
Opportunistic Allocation
9. Signals
Signal Concepts
Basic Signal Management
Sending a Signal
Reentrancy
Signal Sets
Blocking Signals
Advanced Signal Management
Sending a Signal with a Payload
Conclusion
10. Time
Times Data Structures
POSIX Clocks
Getting the Current Time of Day
Setting the Current Time of Day
Playing with Time
Tuning the System Clock
Sleeping and Waiting
Timers
Appendix. GCC Extensions to the C Language
Bibliography
Index