
Advanced programming in the Unix environment
by W. Richard Stevens, Stephen A. Rago · first published 1992
74% recommend24% neutral2% critical
Why HN recommends it
Thorough walk through Unix system calls and subsystems (files, processes, signals, IPC, ttys/ptys), useful as a reference after the first chapters. Suits C programmers who want to understand how the OS works.
Summarised by Claude from recommending comments
Rago carefully retains the spirit and approach that made this book a classic. Building on Stevens' work, he begins with basic topics such as files, directories, and processes, carefully laying the groundwork for understanding more advanced techniques, such as signal handling and terminal I/O. Substantial new material includes chapters on threads and multithreaded programming, using the socket interface to drive interprocess communication (IPC), and extensive coverage of the interfaces added to the latest version of the POSIX. 1 standard. Nearly all examples have been tested on four of today's
Affiliate links. As an Amazon Associate I earn from qualifying purchases.




…better, choices, if you're willing to spend a few dollars (and hopefully expense it to your manager): The Linux Programming Interface: http://www.amazon.com/Linux-Programming-Interface-System-Han... Advanced Programming in the UNIX Environment: http://www.amazon.com/Advanced-Programming-UNIX-Environment-... A not-too-distant third choice, Linux System Programming: http://www.amazon.com/Linux-System-Programming-Talking-Direc...
on “Advanced Linux Programming – book with free PDF (2001)” ↗Books I'll treasure forever: - Advanced Programming in the Unix Environment by Stevens - Operating Systems: Design and Implementation by Tanenbaum - The Art of Unix Programming by ESR - Parsing Techniques by Grune and Jacobs - Applied Cryptography by Schneier
on “Ask HN: What language-agnostic programming books should I read?” ↗…love it. If not, it will read like unstructured drivel. Maybe, I am too negative. But if you are a non-UNIX programmer, and have to work on a UNIX project, there are far better books available. (E.g. Advanced Programming in the UNIX Environment, by W. Richard Stevens and Stephen Rago)
on “The Art of Unix Programming” ↗…and others. Documentation for fork() clearly explains why and when fork() returns -1. Those that find the man page lacking or elusive may get more out of an earnest study of W. Richard Stevens' book, Advanced Programming in the UNIX Environment. In any case, every system programmer should own a copy and understand its contents.
on “fork() can fail” ↗…small and the amount not already covered in the text is even smaller so it wouldn't take long to skim. Of course it doesn't cover Unix-specific functions, like the unistd.h header; for that, I recommend Advanced Programming in the Unix Environment.
on “Inside the C Standard Library” ↗Computer Architecture: A Quantitative Approach by John L. Hennessy the creator of MIPS and David Patterson the creator of Berkeley RISC (later SPARC) Advanced Programming in the Unix Environment by W. Richard Stevens
on “Ask HN: Which books do you consider real gems in your field of work/study?” ↗…stuff in Unix. Very old school, but still very relevant - those are the root of many of Unix's strengths. (K&P's _The Practice of Programming_ is also excellent, though not as specific to Unix.) 2. _Advanced Programming in the UNIX Environment_, 2nd ed., by (the late) W. Richard Stevens. This and man pages will go a long way. 3. The man pages themselves. It's generally understood that OpenBSD's man pages are particularly well written, but…
on “* is Unix” ↗…me some that people (myself included) keep writing 900 page programming books when this can do nearly the same in 200. Once you're done with that, pick up one of the W. Richard Stevens (RIP) books — Advanced Programming in the Unix environment, or Unix Network Programming (Vol i/ii) if you're into networks. They'll teach you the basics of so much operating system stuff (it'll be Unix, but the core concepts will apply to any modern OS) you'll…
on “Ask HN: An Advanced C Tutorial” ↗IMO, this is a better book at explaining C clearly: "advanced programming in the unix environment" by W. Richard Stevens. Don't be fooled by the title.. it's a beginner book.
on “Deconstructing K&R C (2010)” ↗…program. Slides are presented as a video. For textbooks, we had Operating Systems Concepts by Silberschatz. I didn't like the book that much. Hope this helps! EDIT: I did like more the "recommended" book Advanced Programming in the UNIX Environment by Richard Stevens and Stephen A. Rago
on “Ask HN: Good online course on operating systems?” ↗If you often wonder about such things, I highly recommend the book "Advanced programming in the UNIX environment" by Stevens/Rago: https://en.m.wikipedia.org/wiki/Advanced_Programming_in_the_... It covers a lot of stuff in an authoritative way. For example, how one should implement a daemon properly (e.g., chdir…
on “Create Your Own Shell in Python” ↗…not portable APIs that don't have necessarily to do with UNIX. It doesn't matter that the kernel is UNIX like, if what is on top of it isn't. And anyone that only knows GNU/Linux as UNIX, should read "Advanced Programming in the UNIX Environment" from W. Richard Stevens/Stephen A. Rago, to see what actually means to write portable UNIX code across POSIX implementations.
on “A Generation Lost in the Bazaar (2012)” ↗…of what you would need and want to know when connecting to a remote linux system over ssh. If you want to get under the hood and become an expert, the following books should help get you started: [2] Advanced Programming in the UNIX Environment [3] The Linux Programming Interface: A Linux and UNIX System Programming Handbook [4] Linux Kernel Development 3rd Edition To get a nice general overview and get up and going quickly: [5] How Linux…
on “Ask HN: Best Resources to Learn to Manage Linux Boxes via SSH” ↗Even then... Where are you going to start in reading references? A random syscall or function a day? I think it is far more useful to e.g. read the late W. Richard Stevens' Advanced Programming in the Unix environment. It puts everything in context, provides historical background where necessary, and gives examples. Reference pages are not really for brushing up, but more for the 'what was the address family field…
on “Brushing up on operating systems and C programming” ↗W. Richard Stevens. /old man yelling at cloud mode on: do kids these days really need to look up who wrote Advanced Programming in the Unix Environment??
on “CS631: Advanced Programming in the Unix Environment” ↗