Book description
Write software that draws directly on services offered by the Linux kernel and core system libraries. With this comprehensive book, Linux kernel contributor Robert Love provides you with a tutorial on Linux system programming, a reference manual on Linux system calls, and an insider’s guide to writing smarter, faster code.
Love clearly distinguishes between POSIX standard functions and special services offered only by Linux. With a new chapter on multithreading, this updated and expanded edition provides an in-depth look at Linux from both a theoretical and applied perspective over a wide range of programming topics, including:
- A Linux kernel, C library, and C compiler overview
- Basic I/O operations, such as reading from and writing to files
- Advanced I/O interfaces, memory mappings, and optimization techniques
- The family of system calls for basic process management
- Advanced process management, including real-time processes
- Thread concepts, multithreaded programming, and Pthreads
- File and directory management
- Interfaces for allocating memory and optimizing memory access
- Basic and advanced signal interfaces, and their role on the system
- Clock management, including POSIX clocks and high-resolution timers
Publisher resources
Table of contents
- Dedication
- Foreword
- Preface
- 1. Introduction and Essential Concepts
- 2. File I/O
-
3. Buffered I/O
- User-Buffered I/O
- Standard I/O
- Opening Files
- Opening a Stream via File Descriptor
- Closing Streams
- Reading from a Stream
- Writing to a Stream
- Sample Program Using Buffered I/O
- 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/O
- Conclusion
-
4. Advanced File I/O
- Scatter/Gather I/O
- Event Poll
- 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
- Programs, Processes, and Threads
- The Process ID
- Running a New Process
- Terminating a Process
- Waiting for Terminated Child Processes
-
Users and Groups
- Real, Effective, and Saved User and Group IDs
- Changing the Real or Saved User or Group ID
- Changing the Effective User or Group ID
- Changing the User and Group IDs, BSD Style
- Changing the User and Group IDs, HP-UX Style
- Preferred User/Group ID Manipulations
- Support for Saved User IDs
- Obtaining the User and Group IDs
- Sessions and Process Groups
- Daemons
- Conclusion
-
6. Advanced Process Management
- Process Scheduling
- The Completely Fair Scheduler
- Yielding the Processor
- Process Priorities
- Processor Affinity
- Real-Time Systems
- Resource Limits
-
7. Threading
- Binaries, Processes, and Threads
- Multithreading
- Threading Models
- Threading Patterns
- Concurrency, Parallelism, and Races
- Synchronization
- Pthreads
- Further Study
- 8. File and Directory Management
- 9. Memory Management
- 10. Signals
- 11. Time
-
A. GCC Extensions to the C Language
- GNU C
- Inline Functions
- Suppressing Inlining
- Pure Functions
- Constant Functions
- Functions That Do Not Return
- Functions That Allocate Memory
- Forcing Callers to Check the Return Value
- Marking Functions as Deprecated
- Marking Functions as Used
- Marking Functions or Parameters as Unused
- Packing a Structure
- Increasing the Alignment of a Variable
- Placing Global Variables in a Register
- Branch Annotation
- Getting the Type of an Expression
- Getting the Alignment of a Type
- The Offset of a Member Within a Structure
- Obtaining the Return Address of a Function
- Case Ranges
- Void and Function Pointer Arithmetic
- More Portable and More Beautiful in One Fell Swoop
- B. Bibliography
- Index
- About the Author
- Colophon
- Copyright
Product information
- Title: Linux System Programming, 2nd Edition
- Author(s):
- Release date: May 2013
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781449339531
You might also like
book
Building Microservices, 2nd Edition
As organizations shift from monolithic applications to smaller, self-contained microservices, distributed systems have become more fine-grained. …
book
Designing Data-Intensive Applications
Data is at the center of many challenges in system design today. Difficult issues need to …
book
Clean Architecture: A Craftsman's Guide to Software Structure and Design
Building upon the success of best-sellers The Clean Coder and Clean Code, legendary software craftsman Robert …
book
Database Internals
When it comes to choosing, using, and maintaining a database, understanding its internals is essential. But …