欧宝娱乐

Jump to ratings and reviews
Rate this book

Advanced Programming in the UNIX Environment

Rate this book

"This is the definitive reference book for any serious or professional UNIX systems programmer. Rago has updated and extended the original Stevens classic while keeping true to the original."

芒鈧€滱ndrew Josey, Director, Certification, The Open Group, and Chair of the POSIX 1003.1 Working Group

For over a decade, 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, Stevens' colleague Stephen Rago has thoroughly updated this classic to reflect the latest technical advances and add support for today's leading UNIX and Linux platforms.

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 most widely used UNIX/Linux platforms: FreeBSD 5.2.1; the Linux 2.4.22 kernel; Solaris 9; and Darwin 7.4.0, the FreeBSD/Mach hybrid underlying Apple's Mac OS X 10.3.

As in the first edition, you'll learn through example, including more than 10,000 lines of downloadable, ANSI C source code. More than 400 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 fully updated for contemporary environments.

Advanced Programming in the UNIX脗庐 Environment has helped a generation of programmers write code with exceptional power, performance, and reliability. Now updated for today's UNIX/Linux systems, this second edition will be even more indispensable.

1013 pages, Kindle Edition

First published June 30, 1992

203 people are currently reading
2907 people want to read

About the author

W. Richard Stevens

35books76followers
William Richard (Rich) Stevens was a Northern Rhodesia鈥揵orn American author of computer science books, in particular books on Unix and TCP/IP.

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
935 (54%)
4 stars
526 (30%)
3 stars
191 (11%)
2 stars
51 (2%)
1 star
20 (1%)
Displaying 1 - 30 of 44 reviews
Profile Image for Michael Finocchiaro.
Author听3 books6,132 followers
November 28, 2016
I gave this one 5* because it is an excellent reference for UNIX geeks and belongs in the standard IT cannon for us old farts that came up through the pre-Facebook Era of the 80s and 90s. Highly readable and with excellent examples. A classic.
Profile Image for TK Keanini.
305 reviews77 followers
April 12, 2007
I had the pleasure in my lifetime to take a tutorial from Stevens at a USENIX conference before he passed. It was an experience I will never forget. All of his books capture his ability to transfer very complex information in a way that no one else can quite do for me. Just like you will always remember that teacher who really made your wheels turn, I will always be greatful to Richard Stevens for his contribution to UNIX and TCPIP networking.
Profile Image for Scott Holstad.
Author听24 books82 followers
January 9, 2020
Possibly the best UNIX book I ever read and one of the best tech books ever. I don't know how I could have made it without it.
Profile Image for Bernie4444.
2,463 reviews11 followers
November 29, 2022
Where are AIX, and HP/UX, among other majors?

This book is a fantastic starting point in life. Somehow our public schools overlook teaching the fundamental skills presented in this book. We learn how to play with toys on simple computers and never really learn what we are doing.

The real strength of this book is in the definitions. We get to see the purpose and flexibility of system calls and functions. Not just use them but understand them. UNIX functions as job control or signals are explained in detail. Let's take just one item "waitpid":

The waitpid function provides three features that aren't provided by the wait function.

You will have to read the book to find out what they are. However, there are examples also. Now for people with real systems like AIX all you have to do is add a "k" to the front of the call and you have the AIX kernel function call "kwaitpid"; voila you now have an understanding that cannot be found clearly in a Red Book.

It does help some to have a pre-understanding of the system so that you can use the book to fill in the education holes missed when necessary.

The index is worth its weight in gold as you can find functions, headers, and concepts all in alphabetical order. My favorite is the definitions.

As much as I am a fan of the internet it also pays to carry the information in the form of a book. And all this book has to do is save a couple of hours and it has paid for itself.

Each addition adds newer information at the expense of dropping what appears to be obsolete information; so, it would behoove you to obtain a copy of each addition and periodically look for the latest.
Profile Image for Prashanth.
2 reviews2 followers
April 14, 2013
+ Comprehensive, both in breadth, and in depth

- Dry

Compared to writers such as Kernighan, Pike and Ritchie, I find Stevens' style awfully boring. K, P and R, for example, bring in interesting problems (e.g. Markov chains) to solve with the tools they are going to introduce to us. Stevens, in contrast, sticks to just explaining functions, mechanism, etc.

Good reference, but boring.
230 reviews44 followers
October 26, 2018
Stevens had an amazing ability to simply and clearly explain technical topics that can be quite complex. While I knew quite a bit about UNIX system programming, these book helped pull this topic together in a more complete way that I could have on my own, or by reading several other books. I still find myself regularly reaching for this book.
56 reviews
February 23, 2017
First read this in my first year after college graduation. There is fantastic clarity in exposition and I absolutely loved the book/page layout and font standards. It really hooked me into the whole Unix philosophy. Absolutely one of the best written and best-looking programming books.
Profile Image for Vasil Kolev.
1,116 reviews199 followers
August 22, 2015
Probably the best book on any UNIX programming. It's good for novices, and everyone can learn something from the book. It doesn't contain some of the weird and new interfaces some of the OSes contain, but sticks to the standards and promotes a pretty good programming style and interface.
65 reviews
July 16, 2008
This and K&R C are the 2 best books on Unix programming.
Profile Image for Chris.
67 reviews1 follower
January 3, 2011
Finally started reading this. Great book, wish I read it 4 years ago when it would have been more helpful. Much faster way to learn the gist of the commands than reading man pages.
Author听2 books
December 30, 2011
One of my favorite books from the past. I still have a copy of this book on my shelf. Good memories.
Profile Image for Warren Mcpherson.
196 reviews31 followers
February 7, 2013
Very approachable and readable, much bigger than most other things on my bookshelf, this book delivers a wonderful insight into the details of Unix architecture and programming.
Author听7 books
June 8, 2017
A really good book about programming in UNIX. I've learned a great deal from this book. From time to time it can be a bit boring and cumbersome, but overall an excellent book.
Profile Image for Arun.
207 reviews65 followers
March 25, 2018
Working through this book again... Nothing short of 5 starts would do for this one of a kind
book written by an Unix god.
31 reviews2 followers
July 3, 2018
Top notch book from Stevens. Should be required reading in all CompSci programs.
15 reviews
November 5, 2018
Very good book to learn programming in Unix
I read till chaper 8, I will read again sometime
Profile Image for Kai Weber.
505 reviews43 followers
June 23, 2024
This book is about writing programs in C that interact with typical kernel interfaces in UNIX systems. The book considers the POSIX standard, along with some further standards like the Single UNIX Specification (SUS). The interfaces described and the code written here is tested to work with certain releases of OpenBSD, Linux, MacOS, and Solaris. Overall the approach is practical, not academical: Occasionally you'll find some empirical benchmarking being run on the four mentioned systems to figure out the efficiency of certain approaches.

As should be clear from the title, this book is not about writing contributions to the kernel code of a UNIX-like system, it's about writing programs that run in the user space UNIXoid operating systems. After the basics of file systems and file access have been dealt with, the book moves on to introduce the different types of communications between threads, processes and machines, like pipes, streams, sockets, shared memory. What is commonly associated with advanced topics in this context, is given due space here: Multithreading, inter-process communication, mutual exclusion without deadlocking.

After having dealt with all of its topics on a rather microscopic level with only small examples, the book is rounded off with two chapters, where larger sections of code are reproduced with extensive commentary. Those two examples are well chosen: First we see the implementation of a simple key-value database system, where efficiency is tried to be achieved by using byte-range locking (i. e. locking of only portions of a file, rather than locking entire files, to allow concurrent write access to different portions of a database file). The second example is showing the implementation of a print spooling process, thereby elaborating on daemon processes and network communication.

Some familiarity with C is necessary to make use of this book, though it needn't be on expert level.
Profile Image for Bernie4444.
2,463 reviews11 followers
November 29, 2022
Where are AIX, and HP/UX, among other majors?

This book is a fantastic starting point in life. Somehow our public schools overlook teaching the fundamental skills presented in this book. We learn how to play with toys on simple computers and never really learn what we are doing.

The real strength of this book is in the definitions. We get to see the purpose and flexibility of system calls and functions. Not just use them but understand them. UNIX functions as job control or signals are explained in detail. Let's take just one item "waitpid":

The waitpid function provides three features that aren't provided by the wait function.

You will have to read the book to find out what they are. However, there are examples also. Now for people with real systems like AIX all you have to do is add a "k" to the front of the call and you have the AIX kernel function call "kwaitpid"; voila you now have an understanding that cannot be found clearly in a Red Book.

It does help some to have a pre-understanding of the system so that you can use the book to fill in the education holes missed when necessary.

The index is worth its weight in gold as you can find functions, headers, and concepts all in alphabetical order. My favorite is the definitions.

As much as I am a fan of the internet it also pays to carry the information in the form of a book. And all this book has to do is save a couple of hours and it has paid for itself.

Each addition adds newer information at the expense of dropping what appears to be obsolete information; so, it would behoove you to obtain a copy of each addition and periodically look for the latest.
2 reviews
August 13, 2023
This is an awesome book. It's very clear and comprehensive. You will know what a unix operating system can do from this book.
I like the final two chapters, but unfortunately, the printer program cannot run.
1 review
September 29, 2022
It's a clear and easy to understand programming for all UNIX programmers.
This entire review has been hidden because of spoilers.
40 reviews
December 23, 2016
Quote:
Earlier versions of the UNIX System did not have the mkdir function; it was introduced with
4.2BSD and SVR3. In the earlier versions, a process had to call the mknod function to create a
new directory 鈥� but use of the mknod function was restricted to superuser processes. To
circumvent this constraint, the normal command that created a directory, mkdir(1), had to be
owned by root with the set-user-ID bit on. To create a directory from a process, the mkdir(1)
command had to be invoked with the system(3) function.
Profile Image for Kam Yung Soh.
901 reviews50 followers
December 31, 2013
A good summary and guide to advanced programming in the Unix environment. Covers most of the major Unix APIs and shows you not only how to use the interfaces but how to use them properly and securely.
Profile Image for Dimitri.
1 review1 follower
Read
August 9, 2012
niiiice!!!
This entire review has been hidden because of spoilers.
Displaying 1 - 30 of 44 reviews

Can't find what you're looking for?

Get help and learn more about the design.