Advanced Programming in the UNIX Environment, 3/e (美國原版)

W. Richard Stevens, Stephen A. Rago



For more than twenty years, serious C programmers have relied on one book for practical, in-depth knowledge of the programming interfaces that drive the UNIX and Linux kernels: W. Richard Stevens’ Advanced Programming in the UNIX® Environment . Now, once again, Rich’s colleague Steve Rago has thoroughly updated this classic work. The new third edition supports today’s leading platforms, reflects new technical advances and best practices, and aligns with Version 4 of the Single UNIX Specification.


Steve carefully retains the spirit and approach that have made this book so valuable. Building on Rich’s pioneering work, he begins with files, directories, and processes, carefully laying the groundwork for more advanced techniques, such as signal handling and terminal I/O. He also thoroughly covers threads and multithreaded programming, and socket-based IPC.


This edition covers more than seventy new interfaces, including POSIX asynchronous I/O, spin locks, barriers, and POSIX semaphores. Most obsolete interfaces have been removed, except for a few that are ubiquitous. Nearly all examples have been tested on four modern platforms: Solaris 10, Mac OS X version 10.6.8 (Darwin 10.8.0), FreeBSD 8.0, and Ubuntu version 12.04 (based on Linux 3.2).


As in previous editions, you’ll learn through examples, including more than ten thousand lines of downloadable, ISO C source code. More than four hundred system calls and functions are demonstrated with concise, complete programs that clearly illustrate their usage, arguments, and return values. To tie together what you’ve learned, the book presents several chapter-length case studies, each reflecting contemporary environments.


Advanced Programming in the UNIX® Environment has helped generations of programmers write code with exceptional power, performance, and reliability. Now updated for today’s systems, this third edition will be even more valuable.


二十多年來,嚴肅的 C 程序員一直依賴一本書來獲得關於驅動 UNIX 和 Linux 內核的編程接口的實用、深入的知識:W. Richard Stevens 的《UNIX 環境高級編程》。現在,Rich 的同事 Steve Rago 再次全面更新了這本經典著作。新的第三版支持當今領先的平台,反映了新的技術進步和最佳實踐,並與單一 UNIX 規範的第四版保持一致。

Steve 精心保留了這本書的價值所在的精神和方法。在 Rich 的開創性工作基礎上,他從文件、目錄和進程開始,仔細奠定了更高級技術的基礎,如信號處理和終端 I/O。他還全面涵蓋了線程和多線程編程,以及基於套接字的進程間通信。

這本新版涵蓋了七十多個新的接口,包括 POSIX 非同步 I/O、自旋鎖、屏障和 POSIX 信號量。大多數過時的接口已被刪除,除了一些無處不在的接口。幾乎所有的示例都在四個現代平台上進行了測試:Solaris 10、Mac OS X 版本 10.6.8(Darwin 10.8.0)、FreeBSD 8.0 和 Ubuntu 版本 12.04(基於 Linux 3.2)。

與以往版本一樣,你將通過示例學習,其中包括一萬多行可下載的 ISO C 源代碼。超過四百個系統調用和函數通過簡潔、完整的程序進行演示,清楚地說明了它們的用法、參數和返回值。為了將所學內容結合起來,本書還提供了幾個章節長度的案例研究,每個案例都反映了當代環境。

《UNIX 環境高級編程》幫助了幾代程序員寫出具有卓越的功能、性能和可靠性的代碼。現在更新為今天的系統,這第三版將更加有價值。