Written in a clear paedagogical style, Professor Stevens demonstrates mastery of the subject, and his desire to pass that expertise on to the reader.
The API's are illuminated by clear examples of their use. He also mentions many of the pitfalls to look out for when programming across the different flavours (BSD, SRV4) and different standards (POSIX, ANSI).
It is a comprehensive tome that represents real value for money.
I use this book so much I will probably need to buy another copy in a few years, if it doesn't go on permanent loan first.
Buy it!
As an example, I had to reference them again this weekend. I am using Visual Basic and C++ under Windows to connect some UDP/IP communications between applications. Once again, these books were indispensable (even after looking at online help, Google, Microsoft Knowledge Base and Experts-Exchange). Any Internet professional should have both of these books on their shelf.
Everything from basic I/O to terminals is covered, which should be enough to write your own operating system if you ever felt the inclination to do so. All the important defined constants are listed out in tables. The book has a very clear structure that makes it easy to find what you want when you want it. There's also an exhaustive index that assists in the reference of more obscure items.
Since C is still used as a 'high-level assembly language,' especially in the development of fast applications like operating systems, this is a necessary reference in the library of any programmer. Accept no substitutes- Stevens' book is the very best.
Required reading for any aspiring Unix system programmer, this book serves as both a great book for learning as well a reference. I've had this book for close to 10 years, and I still refer to it.
Evrey Unix programmer should have a copy of this book.
This book consists of 19 chapters. The first half explains Unix environment that you should aware of when you do programming in Unix. The second (last) half of the book contains 'the advanced Unix programming.' I thought I could skip the first half of this book and go straight to the advanced programming, but then I realised, that if I have never read the basics of Unix programming, then I should read the first half of the book first.
Richard Stevens is so clever to arrange the sequence of the chapters. Each chapter is like a 'linked-list' (if you're a C programmer, you know what I'm talking :) ), in order to understand a certain chapter, you must first understand the preceeding chapter.
If you go to BrainBench.com and check their test syllabus for Unix Programming, this book definitely covers the syllabus. Although I have never taken their test for Unix programming, I think the guys at brainbench are also using this book when developing the test.
If you had other Stevens' book like the famous "Unix Network Programming," (UNP) this book is a must! There's a lot of things I cannot understand when reading UNP until I read this book. But I should warn you: This book is definitely NOT for beginners....
From the first 14-15 chapters it seems like this is one of the best API references I saw. It's not just Unix, it's the way the author writes. He tells you what can be done, how exactly and what to watch for. Typical chapter can look something like:
---
Chapter 93. Cooking Eggs.
Eggs are one of the delicious and nutricious meals. Kitchenware provides the following functions to cook eggs:
egg_t eboil(egg_t egg, time_t time);
egg_t epanfry(egg_t egg, time_t time);
egg_t emicrowave(egg_t egg, time_t time);
All three functions take egg and time to cook and return egg. If time is 0 the egg is cooked until ready. If time is less than 0, it's cooked either for abs(time) or until ready whichever is less. Note, that only superuser can microwave an egg. Historically, these functions were written to operate with kitchen eggs only. Latest versions of Kitchenware add a function yolkctl(egg_t egg, bird_t whose) that you call with eggs before you pass them cooking functions.
Exercises:
1. Microwave an egg. What happened ? Explain why.
---
Well, this is just a few lines, whereas in the book it takes pages and pages of very detailed pedantic explanation. And this was great until approximately chapter 14, when the author started to put more and more sample code inline, in pursue of showing the functional working application or set of functions. This is one of the downsides (to me, if you like to dig through C code rather than reading plain text words - all the better). I think that a book like that should be a reference. The author does not show any algorithms and ideas anyway, so why bothering writing something big ? Give men a bricks and they will build the house themselves.
The other downside is also about the C sample code. As I said - the way Mr. Stevens writes text is very good. And the code is good as well, but not for a sample. In every single sample he is checking every possible error and not simply puts nice little trellis (...) where error handling should be, but actually handles them. Too pedantic and turns half of all the samples into calls to err_output or something. And at the very same time he uses custom header file (ourhdr.h) listed in appendix X, thus making it confusing to catch which is a new function you are reading about, and which is another auxiliary macro from that custom header.
One more thing - the book is basically all about The bottom line is, this book makes a good reference in basic Unix API.
Stevens' writing style is relaxed but focussed. It's easy to follow his points, which is not a short list. The book is 740 pages, the font size is modest, the margins thin. The coverage is comprehensive, making it a useful reference. What I appreciate though is that Stevens didn't slide on too many topics, something references do when the reader is likely to spot-read. It's a well-organized book, full of many well-thought out descriptions and examples.
The reader must bring some C programming and Unix systems experience to appreciate this book; it doesn't complement intuition or mere absorption very well. Intelligent systems programming starts with someone who needs things the operating system can provide, and needs to know how asking for resources changes application and OS behavior. Without some foundation, this book is just a very thick list of some special function calls.
Buy this book only after you're comfortable with your compiler. Otherwise it'll get buried under a mound of installation and release notes, and put back on the shelf when your time runs out. A book like this deserves 2-3 days of study that is unbroken by tracking down tangents you're not familiar with; save your $60 until you have that kind of time and preparation.
Maybe the only downside is that this is a book is clearly targeted for the advanced. Beware! I don't know if I'd call this "enjoyable reading".
Definitely a must reference for the bookshelf.
Preface
1. Introduction (a "whirlwind tour of Unix")
2. Unix Standardization and Implementations
3. File I/O
4. Files and Directories
5. Standard I/O Library
6. System Data Files and Information
7. The Environment of a Unix Process
8. Process Control
9. Process Relationships
10. Signals
11. Terminal I/O
12. Advanced I/O
13. Daemon Processes
14. Interprocess Communication
15. Advanced Interprocess Communication
16. A Database Library
17. Communicating with a PostScript Printer
18. A Modem Dialer
19. Pseudo Terminals
Appendices
A. Function Prototypes
B. Miscellaneous Source Code (all source code is available for download)
C. Solutions to Selected Exercises
Bibliography
Index
The first thing to understand about the book is that while it can be used as just a reference work (the index is wonderful), it really is a book you can and should read. Even if you think you know a lot of this stuff, you can be surprised at what you can still learn.
What makes the book so much more useful than just a collection of man-page print-outs (that dreary and painfully common form of UNIX "book") is the method of presentation. Stevens' basic atom of organization is the function call. For each call (or minor variations on a single call), he provides the C prototype, and then, in text, explains what the function does, what it's arguments are for, and then typically provides a small C program that demonstrates it in action, which he then explains. These function-level building blocks are arranged into related sets, each of which is a chapter in the book. Each chapter has a wrapper that consists of an introduction explaining some basic concepts and history of the functions described in that chapter, and some review exercises at the end. The chapters themselves are arranged so that the earlier chapters describe the basic functions, and the later chapters describe the more difficult functions. Every chapter both teaches the reader something of immediate use in writing code (even the introduction has sample programs), as well as preparing him for the more difficult subjects that lie ahead.
Now for the caveats. Stevens absolutely assumes that you know how to program in C and that you know how to use Unix development tools (or at least that you have some other source from which to learn them). This is not the book to learn how to use C or particular shells, editors, compilers, linkers, or debuggers. Similarly, new Unix variants, such as Linux and MacOS X, receive no specific mention here at all (though the book is invaluable for both). Also, there is no discussion of the various GUI interfaces offered on many current Unix systems - for those, some other book will necessary.
One other thing worth mentioning is the cost of the book. Don't be put off by it - Stevens' book has been justifying that cost for a lot of readers for a lot of years.
In closing, I've been a developer for many years and have owned many computer books. I recommend very few of them, but can't recommend this one highly enough. It is one of the few books I've had that routinely lies open beside me when I work. In addition to my personal recommendation, you might look not only at all the positive reviews for this book, but also at the reviews for "competitive" books and notice how often they refer you back to this one. This book is the standard by which other UNIX programming books are measured, and so far, it has not been surpassed.
After you get this book, you may want to do some socket (internet) programming. Since this book doesn't cover sockets in depth, I'd recommend (as a complement), "UNIX Network Programming, Volume 1: Networking APIs - Sockets and XTI " also by W. Richard Stevens.