内容简介
如何编写那些直接依赖于Linux内核和核心系统库提供的服务的软件?通过《Linux系统编程(影印版第2版)》这本详尽的书籍,Linux内核参与者Robert Love(洛夫)为你提供了Linux系统编程方面的教程,Linux系统调用的参考手册,以及对于如何编写更聪明和更快的代码的来自内部人士的建议。 Love清晰地指出了POSIX标准函数和Linux提供服务之间的差异。通过关于多线程的新章节,这本修订和扩展的版本在理论和实践上相结合,从多个编程主题上提供了深入的见解。
目录
Foreword
Preface
1. Introduction and Essential Concepts
System Programming
Why Learn System Programming
Cornerstones of System Programming
System Calls
The C Library
The C Compiler
APIs and ABIs
APIs
ABIs
Standards
POSIX and SUS History
C Language Standards
Linux and the Standards
This Book and the Standards
Concepts of Linux Programming
Files and the Filesystem
Processes
Users and Groups
Permissions
Signals
Interprocess Communication
Headers
Error Handling
Getting Started with System Programming
2. File I/O
Opening Files
The open() System Call
Owners of New Files
Permissions of New Files
The creat0 Function
Return Values and Error Codes
Reading via read()
Return Values
Reading All the Bytes
Nonblocking Reads
Other Error Values
Size Limits on read()
Writing with write()
Partial Writes
Append Mode
Nonblocking Writes
Other Error Codes
Size Limits on write()
Behavior of write()
Synchronized I/O
fsync0 and fdatasync0
sync0
The O SYNC Flag
O_DSYNC and O_RSYNC
Direct I/O
Closing Files
Error Values
Seeking with lseek0
Seeking Past the End of a File
Error Values
Limitations
Positional Reads and Writes
Error Values
Truncating Files
Multiplexed I/O
select()
poll()
poll() Versus select()
Kernel Internals
……
3. Buffered I/O
4. Advanced File I/O
5. Process Management
6. Advanced Process Management
7. Threading
8. File and Directory Management
9. Memory Management
10. Signals
11. Time
A. GCC Extensions to the C Language
B. Bibliography
Index