Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror

Advanced Programming in the UNIX Env, 2nd Ed. 128

Eater writes "W. Richard Stevens wrote Advanced Programming in the UNIX Environment, which was published in 1993 by Addison-Wesley. It quickly became the cornerstone of many bookshelves. The original edition has been revised by Stephen A. Rago to more accurately reflect the current landscape of UNIX and UNIX-like systems. APUE is targeted at the experienced C programmer with a working knowledge of UNIX. It includes chapter long examples of real-world applications, and--as with other works by W. Richard Stevens -- somehow manages to serve simultaneously as an enlightening tutorial and a valuable reference book." Read on for the rest of Eater's review of the book's recent second edition.
Advanced Programming in the UNIX Environment, 2nd Ed.
author W. Richard Stevens, Stephen A. Rago
pages 927
publisher Addison-Wesley
rating 9
reviewer Eater
ISBN 0201433079
summary Essential classic for experienced C progammers working in UNIX environments

Few technical authors have had such a great impact on the geek community as Rich Stevens, and because of this, any review of his books should include a few words about the man himself.

Stevens' work typically tops any "recommended reading" list when it comes to TCP/IP networking or UNIX programming. Stevens passed away on September 1st, 1999. In addition to APUE, he authored UNIX Network Programming (Volume 1: APIs and Volume 2: IPC) and TCP/IP Illustrated (Volume 1: Protocols, Volume 2: Implementation, and Volume 3: TCP/T, HTTP, NNTP, Unix Domain Protocols.) Stevens was posthumously awarded the USENIX Lifetime Achievement Award for his extraordinarily lucid teaching and generous spirit within the community, which was accepted on his behalf by his surviving wife and children. (Slashdot coverage of his unfortunate death is available.)

Stephen A. Rago, who has taken on the daunting task of revising Stevens' APUE, worked at Bell Laboratories as a UNIX SVR4 developer. His first contact with Rich Stevens was an e-mail regarding a typographical error in Stevens' first book, UNIX Network Programming. Stevens later acted as a technical reviewer for Rago's UNIX System V Network Programming. Rago reciprocated as a technical reviewer for the first edition of APUE, and has done a fine job of revising that same text for the new second edition.

After more than a decade of changes in UNIX and UNIX-like operating systems, the original edition of APUE holds up well. Rago's revision reflects the following:

  • System V variants are being replaced by Linux, Solaris being the last of these with any reasonable market share.
  • 4.4BSD was the last UNIX release officially maintained by Berkeley's CSRG, with subsequent derivatives being maintained by volunteers.
  • The popularity of Linux and inexpensive x86 hardware has introduced a notable shift in development.
  • Apple Computer has abandoned its previous operating system for one based on Mach and FreeBSD.
  • The original book was based on the 1990 version of the POSIX.1 standard. The new edition has incorporated changes from the 2001 version.
  • Chapters on threads and thread control have been added.
  • Some material has been omitted to reflect changes in common hardware. For example, the "Modem Dialer" example from the first edition has been removed, and "Communicating with a PostScript Printer" (which focused on serial and parallel communication) has been replaced with "Communicating with a Network Printer".

The following platforms were used in Rago's edition:

  • FreeBSD 5.2.1 on Intel Pentium
  • Linux 2.4.22 (Mandrake 9.2) on Intel Pentium
  • Solaris 9 on 64-bit UltraSPARC IIi
  • Darwin 7.4.0 (Mac OS X, version 10.3) on PowerPC

A comparison of the tables of contents between the first and second editions indicates only minor organizational changes. When delving into the text, it's apparent that Rago has done a painstaking job of reworking the text to reflect the changes over the past 13 years.

Notably, Rago has included a few new helpful tables in the chapter on UNIX standardization. These tables compare the differences among the four platforms he used in writing this edition, making this text rather valuable for those trying to support multiple offerings.

An entirely new part of this edition is two chapters dealing with POSIX threads. Rago presents this material first with an introductory chapter on threads, POSIX.1 primitives available for creating and destroying threads, and a discussion of the fundamental issues when dealing with synchronization between threads. The follow-up chapter is on thread control, dealing with the specifics of synchronization, reentrancy, and thread interaction with process-oriented system calls.

Stevens believed that the best way to learn code was to read code, and his books reflect that philosophy well. The original edition contained a chapter titled "Communicating with a PostScript Printer" that included a complete program to communicate over a RS-232 serial connection to an attached printer. Most PostScript printers today are accessed via a network interface, and Rago has managed to rewrite the material reflecting this while still maintaining the original intent of the chapter. The first edition's chapter on modem communication has been omitted from the new edition, but is still available via the book's website.

This book is no superficial rewrite of the first edition. From cover to cover, it's apparent that Rago has carefully interpreted the original text and rewritten it to accurately reflect the changes of the past 13 years; he has also managed to preserve to original lucid and efficient presentation style of Stevens' classic.

The book's official website is available here, including all source-code examples and errata.


You can purchase Advanced Programming in the UNIX Environment, 2nd Ed. from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
This discussion has been archived. No new comments can be posted.

Advanced Programming in the UNIX Env, 2nd Ed.

Comments Filter:
  • old skool linux (Score:0, Redundant)

    by brucem4179 ( 898273 ) on Tuesday July 12, 2005 @04:40PM (#13046854)
    • FreeBSD 5.2.1 on Intel Pentium
    • Linux 2.4.22 (Mandrake 9.2) on Intel Pentium
    • Solaris 9 on 64-bit UltraSPARC IIi
    • Darwin 7.4.0 (Mac OS X, version 10.3) on PowerPC
    Gee a bit old on the old linux front, no? Are a lot of people still using the 2.4 series?
    • by Anonymous Coward on Tuesday July 12, 2005 @04:47PM (#13046962)
      Yes.
    • Re:old skool linux (Score:2, Insightful)

      by radarsat1 ( 786772 ) on Tuesday July 12, 2005 @04:49PM (#13046982) Homepage
      haven't read the book or anything, but i get the impression that it's mostly about user-space system-level programs. A lot of this is not really affected by the exact kernel version. Although I guess a lot of 2.6-specific stuff like udev and whatnot might be affected.

      In a way though, the distribution and the way the filesystem is organized is more important than the particular kernel.
      • by OwnedByTwoCats ( 124103 ) on Tuesday July 12, 2005 @05:25PM (#13047424)
        I wrote a lot of code using Stevens' Unix Network Programming. Highly, highly, highly recommended. Theory and practice, in one volume. Understanding how the C API works helps one understand network programming in every other language...

        I have access to the first edition of APUE from the library, so I won't be running out to buy a new copy.
    • Re:old skool linux (Score:2, Insightful)

      by pianoman113 ( 204449 ) on Tuesday July 12, 2005 @04:55PM (#13047065) Homepage
      While I have no hard numbers to back this statement up, I would venture to guess that there are many people out there still using the 2.4 series kernel, just as there were many using 2.2 at this point in the 2.4 release series. In fact, there are probably a handful of people still using 2.2 and a very small number still on 2.0.

      Not everyone can afford to be on the cutting edge.
    • by Anonymous Coward on Tuesday July 12, 2005 @04:58PM (#13047108)
      uhh... yes... anyone who is running an Enterprise Linux distro that's more than a few months old.
    • by wesleyt ( 745624 ) * on Tuesday July 12, 2005 @05:33PM (#13047540) Homepage
      2.4.22 isn't really old, not in the business world. Red Hat will be maintaining the 2.4 kernel in Red Hat Enterprise Linux 3 (RHEL 3) for a number of years to come.

      Of the twenty-odd Linux servers I maintain here at work, most are running Red Hat 7.x, with the Opterons running RHEL 3. All are 2.4-based.

      I'm upgrading one RHEL 3 server to RHEL 4 (with a 2.6 kernel) tomorrow purely to remain under a vendor's maintenance argeement. I'm not really happy about it.

      My motto for systems administration: if it ain't broke, don't fix it. If it breaks and you can patch it without upgrading the OS, do that. Most RH8 and RH9 packages recompile fine in RH7 with a bit of tweaking. If they don't, then the source tarballs usually do.

      Typically, I'll replace the OS when I replace the hardware.
    • Comment removed (Score:5, Insightful)

      by account_deleted ( 4530225 ) on Tuesday July 12, 2005 @05:48PM (#13047710)
      Comment removed based on user account deletion
    • by Anonymous Coward on Tuesday July 12, 2005 @06:34PM (#13048172)
      I'm still on 1.0 you insensitive clod!!
  • by cerberusss ( 660701 ) on Tuesday July 12, 2005 @04:42PM (#13046878) Journal
    What I always liked about Stevens, is that he delivered print-ready copy to his publisher. This guy did everything himself. Layout, typesetting, graphics, indexing, the whole works. Where can you find people like that nowadays who take so much pride in their product that they hand-hold it from draft to customer?
    • by HyperChicken ( 794660 ) * on Tuesday July 12, 2005 @04:46PM (#13046949)
      Donald Knuth? Created his own typesetting language. Can't get much more "do it yourself" than that.
    • by keesh ( 202812 ) on Tuesday July 12, 2005 @05:09PM (#13047221) Homepage
      Where can you find people nowadays that have time to learn how to do proper layout, typesetting, graphics and indexing as well as knowing all that's necessary to write a book? Division of labour is a good thing.
    • by BYTEBuG ( 630830 ) on Tuesday July 12, 2005 @05:12PM (#13047269)
      8 years ago I was developing a UDP-based distributed messaging system for our local intranet, and got to a point where I couldn't get things working right. I had been using Stevens' books as my references, and I noticed his email address in the preface.

      "What the hey," I thought. "I'll email him." So I did, and then went to lunch.

      Imagine my surprise upon my return when I saw 2 return emails waiting! He explained in great detail what I was doing wrong conceptually, and gave exacting instructions on how to make a certain part work. In the second email, he said it didn't sit well with him to leave me with an "unoptimal solution" (his words), so on his own time he came up with an even better paradigm, and sent actual tested code to implement it!

      What can I say? His books will always grace my shelf.
    • by autosentry ( 595252 ) on Tuesday July 12, 2005 @05:18PM (#13047339)
      As a production manager, I would dread having to troubleshoot something like that. On the other hand, I wouldn't mind it if the author had to troubleshoot it himself . . . I look at open-source typesetting programs a lot, and while I like the idea, I'm bewildered by how I could keep a book on schedule the way I can with Quark or InDesign in a coding language. The Troff website is a little obtuse at the moment, but I wouldn't mind learning more.
    • by account_deleted ( 4530225 ) on Tuesday July 12, 2005 @05:21PM (#13047368)
      Comment removed based on user account deletion
    • I think the Pragmatic Programmers [pragprog.com] do just that.
    • by Tom Christiansen ( 54829 ) <tchrist@perl.com> on Tuesday July 12, 2005 @07:07PM (#13048496) Homepage
      What I always liked about Stevens, is that he delivered print-ready copy to his publisher. This guy did everything himself. Layout, typesetting, graphics, indexing, the whole works. Where can you find people like that nowadays who take so much pride in their product that they hand-hold it from draft to customer?
      Amongst other things, Richard wrote quite the elaborate but easy-to-use troff macro set to aid in the production of those books.

      You're right: that level of pride in workmanship is nearly (but not quite) unheard of in modern technical publishing. But can a publisher ever really measure up to the exacting standards of the most extreme of precise-minded (aka anal) authors? Probably not. That sort of author is apt to be seen as more than half-mad and too much of a hassle for the publisher to try to work with. "After all," says the publisher, "it's just a book." "Sure, but it's my book!" carps back the meticulous author.

      You asked where one can find such people. The best living example of fastidious attention to detail that springs to mind is Jeffrey Friedl, as seen in his 500-page arcane tome, Mastering Regular Expressions [oreilly.com], now it its second edition. If I recall correctly, Jeffrey did the typesetting, indexing, etc, which means that he was his own production team. This is nearly universally deemed far more trouble than it's worth, but at least you'll have no one to complain about if, for example, the index doesn't measure up--which it seldom if ever does.

      Check out Jeffrey's index [oreilly.com] for MRE (it's in PDF format). Give it a glance. Notice the richness, the usefulness. Notice the multiple levels of headings, rather than just two. Notice the careful treatment of fonts and of the ordering of analphabetic symbols. Many another gem is hidden within that index, which you'll notice if you skim it a bit.

      This sort of quality you will never, ever get from some freelance, paid-by-the-hour indexer who doesn't know the problem space, who won't have their name on that book's cover. It does make a difference.

      Whoops. We now return you from this unintentional pæan to MRE's production quality.

      On Richard Stevens, he was a marvelous and wonderful human being, and he is missed, not just by me, but by many.

      --tom

      • by jericho4.0 ( 565125 ) on Tuesday July 12, 2005 @07:29PM (#13048701)
        "the ordering of analphabetic symbols"

        Did you go to a English public school?

        • by martian265 ( 156352 ) on Thursday July 21, 2005 @05:17PM (#13129319)
          You probably should have looked up the term online before posting such a mean-spirited comment.

          Analphabetic is a word and it has many meanings:

          noun
          1. an illiterate person who does not know the alphabet

          adjective
          1. not alphabetic; "an analphabetic arrangement of letters"; "Jesperson's system of phonetic transcription is analphabetic"
          2. unlettered having little acquaintance with writing; "special tutorials to assist the unlettered sector of society"
          3. relating to or expressed by a writing system that is not alphabetic

          As a side note, this term is usually used when trying to communicate without any type of alphabet, such as when 2 people don't speak the same language and try to communicate using pictures etc.
      • by IvyMike ( 178408 ) on Wednesday July 13, 2005 @03:31AM (#13051194)
        Check out Jeffrey's index for MRE (it's in PDF format). Give it a glance. Notice the richness, the usefulness. Notice the multiple levels of headings, rather than just two. Notice the careful treatment of fonts and of the ordering of analphabetic symbols. Many another gem is hidden within that index, which you'll notice if you skim it a bit.

        This sort of quality you will never, ever get from some freelance, paid-by-the-hour indexer who doesn't know the problem space, who won't have their name on that book's cover. It does make a difference.


        For an offtopic, fictional, and non-serious counter-argument, find a copy of Cat's Cradle by Kurt Vonnegut and read Chapter 55, "Never Index Your Own Book." [libr.org] (you'll have to scroll down with the link I provided, sorry.)

        I'm giving the link because it's so weirdly applicable; how often do I get to reference a passage about authors who self-index? Back in reality, I agree with Tom: Friedl's book and index are perfect.
  • by slashdotnickname ( 882178 ) on Tuesday July 12, 2005 @04:42PM (#13046880)
    I don't mean to sound like a troll, but I already have a few similar books in my dusty collection... so what's new in this one that can't be found in the other books and/or web sites out there? anything exciting enough for me to put on pants and drive down to my Books-a-Million?
    • Re:what's new? (Score:2, Insightful)

      by Alphabet Pal ( 895900 ) on Tuesday July 12, 2005 @05:22PM (#13047386)

      You say "similar" books... do you mean that you already have the first edition, or that you don't have any of Steven's other books? (If you did have any of his books, but not the first edition of this one, you already know what "can't be found in the other books").

      I'll assume you mean you haven't yet read any of his books - beleive me, they're worth it. When I first took an interest in TCP/IP, I passed over his "TCP/IP Illustrated" series for a lot of reasons - they were expensive, there were THREE of them (!), they were out-of-date, they weren't specific to my target environment, etc. I bought some of the other, less expensive alternatives, never learned much that I couldn't learn from reading RFC's, and was finally loaned a copy of "TCP/IP Illustrated, Volume 1". I was blown away by the quality of the book, and the quality of the writing. I've never read such a well-written technical book in my life, and I suspect I never will again. Nobody can clarify like Stevens. He goes through the details (all the details), but still keeps the book interesting.

      I have to clear book purchases with my wife these days (sigh...) but this is one of the books on my wish list. I'll admit I've never read "Advanced Programming in the Unix Environment", but I guarantee that if it was written by W. Richard Stevens, it makes all other books written on the subject useless.

      Now, on the other hand, I have to take this reviewers word that this new guy can write as clearly and as interestingly as Stevens, and so will you.

      • by DanAnderson26 ( 54603 ) on Wednesday July 13, 2005 @01:09AM (#13050709)
        Actually this guy is all wrong.

        He's right about the books, I have them all and use them on a regular basis - No better books on UNIX or IP out there.

        He's wrong about checking with the wife. What you do is buy the books, all of them at once. Then tell your wife you blew the cash at the strip club.

        Dan
  • by xactuary ( 746078 ) on Tuesday July 12, 2005 @04:42PM (#13046882)
    It quickly became the cornerstone of many bookshelves.

    Um, those books never get read - used as they are in making space for shelving to hold the other books!
  • well (Score:0, Offtopic)

    by PunkOfLinux ( 870955 ) <mewshi@mewshi.com> on Tuesday July 12, 2005 @04:44PM (#13046907) Homepage
    apparently, this book, (should i ever come across it)(I have TERRIBLE trouble finding books; when I'm actually looking for them, I can't find them; the MINUTE i stop looking, I find in some weird section of the bookstore) would be a good thing to read if I was planning to get in programming on linux. But, I rather like python [python.org] and am fairly proficient at it. But I might pick this up, just to see if it has any relevant information.
    • Re:well (Score:3, Insightful)

      by tuffy ( 10202 ) on Tuesday July 12, 2005 @04:48PM (#13046973) Homepage Journal
      But, I rather like python and am fairly proficient at it. But I might pick this up, just to see if it has any relevant information.

      I'd highly recommend it, even if you don't do a lot of C programming. For instance, big chunks of Python's os module are thin wrappers around POSIX systems calls. By knowing how those calls work at a low level, you'll be better able to leverage them in your Python code.

  • by csharp_wannabe ( 886975 ) on Tuesday July 12, 2005 @04:45PM (#13046924)
    I fear that this new edition might not be as good as the original just because its not Stevens. Stevens is one of my Heroes of the Comp Sci world, and I pray that his soul is doing well in heaven. I'll just wait until my other friends tell me that the coast is clear
  • troff/groff? (Score:4, Interesting)

    by Amoeba Protozoa ( 15911 ) <`jordan.husney' `at' `gmail.com'> on Tuesday July 12, 2005 @04:49PM (#13046988) Homepage
    I remember reading that all the Stevens books were typeset with troff. I wonder if this new edition has been typset the same way?

    -AP
  • by Anonymous Coward on Tuesday July 12, 2005 @04:49PM (#13046993)
    Of course, it's a 900+ page book and it's only been out for a week or two, but the author of the review didn't do anything other than recap the preface and foreward of the book. In many cases, he quoted sections directly from othe book without attribution.

    Nice "review"
  • by objeck ( 890008 ) on Tuesday July 12, 2005 @04:52PM (#13047023) Homepage
    Back in the day I did a lot of programming against specific operation system API such as Windows and UNIX and had the classic books for each environment. Now that programming environments such as Java and C# exist most of those book just gathering dust. How the UNIX API changed that much since 1993? I have huge book on Win32, MFC and UNIX programming that today are just take up space.
    • by morgan_greywolf ( 835522 ) on Tuesday July 12, 2005 @05:04PM (#13047167) Homepage Journal
      It's not as if Java and C# are the only languages anyone's developing in anymore.

      While many applications can be written for Java and C# or LAMP, or one of many other "platform indepedent" development environments, there are many types of applications that absolutely cannot be because they need access to OS-level or hardware-level APIs.
    • by objeck ( 890008 ) on Tuesday July 12, 2005 @06:07PM (#13047923) Homepage
      Another way of looking at this... with so such content available on the Internet for free is there a real value in buying books that document APIs? I've noticed that most of the books that I buy today are about software development methologies i.e. TDD, Agile, re-factoring etc. I tend to go to the Internet for find the answers to implementing detail and view APIs.
      • by Chemical Serenity ( 1324 ) on Tuesday July 12, 2005 @09:17PM (#13049529) Homepage Journal
        The reason dead tree still sells is that there is a great deal of convenience to having all the pertinent answers in one spot. Additionally, with Stevens work, the answers are not only pertinent but with analysis that is deep and insightful, with copious examples that are invariably correct, and usually represent the best way (or ways, with analysis as to which form is superior based on what it is you're trying to accomplish) to do the task.

        Dry, unadorned documentation about APIs give no suggestions as to best implementation, or often where to look or what to try when things go wrong. Sure, you can look at other coders' code (if you can find something akin to what you're trying to accomplish), but it's obviously a sub-optimal solution.

        Online knowledge is great, don't get me wrong... but when you have the masters of the art willing to author a condense tome filled to the brim with best practices accumulated over a lifetime of projects, it's worth shelling out some clams to have that handy. APUE, UNP (1+2) and TCPIP Illustrated (1,2,3) have saved my sanity on many an occasion, and I suspect they'll do so again.
    • by typical ( 886006 ) on Wednesday July 13, 2005 @01:16AM (#13050753) Journal
      Back in the day I did a lot of programming against specific operation system API such as Windows and UNIX and had the classic books for each environment. Now that programming environments such as Java and C# exist most of those book just gathering dust.

      [minor irritation]

      Yes. You are (according to your webpage) an Eclipse developer. This means that you would not be likely to run into OS-specific things any more than a Win32 developer would care about the details of how named pipes are handled on Unix.

      I admit that most new lines of code out there are probably internal-use stuff that drive websites. For applications like these, getting the application out with a minimum of cost and use of expensive developer time is important, and if there are other concerns, they lie in the realm of reliability of security. Yes, performance doesn't matter much for systems like these, and it's fine to write these in Java.

      However, there *are* those of us that still write embedded code, real-time code, CPU-intensive games, code for horizontal market applications (while I'm less familiar with C#'s prospects, Java has pretty much been a unilateral failure when it came to taking over the horizontal market application space -- take Corel's abortive attempt, for instance), libraries, and code for systems that do many things at once.

      When I sit down to hack on, say, a P2P client, I don't write the thing in Java (granted, some people have). I don't do it because it's a background application that eats CPU cycles, and I don't want it bogging down my computer any more than possible. I don't want want hundreds of thousands of people to throw away megs of memory.

      How the UNIX API changed that much since 1993?

      C99 came out and a bunch of features got added. Threading, realtime scheduling, 64-bit support, large file support, IPC stuff has changed.
    • by objeck ( 890008 ) on Wednesday July 13, 2005 @11:52AM (#13054083) Homepage

      Professionally I'm Java developer but in my spare time I create computer languages primality in C++. My main argument is that large book that document APIs seems to be dated since nearly all of that material is available on the web. As I mentioned, I have a lot of UNIX, Win32 and Java books but I find myself using the Internet more then those books.

      I'll give you an example, I bought a book on pthreads when I prototyping a virtual machine design. The book was about 2 years old and the examples in the book were outdated; the functions syntax had changed. I has able to find working examples and better documentation on the Internet. That being said, this is just how I find my information many of my colleagues still prefer books for reference material.

      It's good to know that the UNIX APIs are being updated. The major revisions that I noticed were IPv6 and as you mentioned 64-bit support.

  • by g0bshiTe ( 596213 ) on Tuesday July 12, 2005 @04:52PM (#13047024)
    programming in the *nix environment, new as in nill, the review neglects to mention how well people with a basic understanding of C with an interest in programming the platform will interpret or even benefit from this book.

    Bieng one of these people, would I benefit more from Stevens book than this title?
    Or would this one make a better selection?
    Should both of them grace my bookshelf?
    • by AuMatar ( 183847 ) on Tuesday July 12, 2005 @06:59PM (#13048421)
      Well, since this is a rewrite with some new additions of the Stevens title, either will work. As for your case, I'd say yes, buy one. The original Stevens was amazing- it explained how to use a Posix OS from the basics of file operations through networking and concurrency. If you haven't ever done systems level programming on Unix, this is THE place to start.
    • by Brandybuck ( 704397 ) on Tuesday July 12, 2005 @07:01PM (#13048431) Homepage Journal
      If you're going to do systems level programming in Unix, this book is a must! Whether or not you would benefit from it elsewise depends on how much the frameworks you use insulate you from the gory details of libc and system calls.
  • Table of contents (Score:2, Insightful)

    by systems ( 764012 ) on Tuesday July 12, 2005 @04:54PM (#13047052)
    The first thing I like to check in a new book is the table of contents, yet the book homepage doesn't seem to have it.
    I hate it when they do that, I'll have to look for it in the publisher 's website.

    • by Anonymous Coward on Tuesday July 12, 2005 @05:01PM (#13047137)
      Copyright
      Praise for Advanced Programming in the UNIX&#174; Environment, Second Edition
      Praise for the First Edition
      Addison-Wesley Professional Computing Series
      Foreword
      Preface
      Introduction
      Changes from the First Edition
      Acknowledgments
      Preface to the First Edition
      Introduction
      Unix Standards
      Organization of the Book
      Examples in the Text
      Systems Used to Test the Examples
      Acknowledgments
      Chapter 1. UNIX System Overview
      Section 1.1. Introduction
      Section 1.2. UNIX Architecture
      Section 1.3. Logging In
      Section 1.4. Files and Directories
      Section 1.5. Input and Output
      Section 1.6. Programs and Processes
      Section 1.7. Error Handling
      Section 1.8. User Identification
      Section 1.9. Signals
      Section 1.10. Time Values
      Section 1.11. System Calls and Library Functions
      Section 1.12. Summary
      Exercises
      Chapter 2. UNIX Standardization and Implementations
      Section 2.1. Introduction
      Section 2.2. UNIX Standardization
      Section 2.3. UNIX System Implementations
      Section 2.4. Relationship of Standards and Implementations
      Section 2.5. Limits
      Section 2.6. Options
      Section 2.7. Feature Test Macros
      Section 2.8. Primitive System Data Types
      Section 2.9. Conflicts Between Standards
      Section 2.10. Summary
      Exercises
      Chapter 3. File I/O
      Section 3.1. Introduction
      Section 3.2. File Descriptors
      Section 3.3. open Function
      Section 3.4. creat Function
      Section 3.5. close Function
      Section 3.6. lseek Function
      Section 3.7. read Function
      Section 3.8. write Function
      Section 3.9. I/O Efficiency
      Section 3.10. File Sharing
      Section 3.11. Atomic Operations
      Section 3.12. dup and dup2 Functions
      Section 3.13. sync, fsync, and fdatasync Functions
      Section 3.14. fcntl Function
      Section 3.15. ioctl Function
      Section 3.16. /dev/fd
      Section 3.17. Summary
      Exercises
      Chapter 4. Files and Directories
      Section 4.1. Introduction
      Section 4.2. stat, fstat, and lstat Functions
      Section 4.3. File Types
      Section 4.4. Set-User-ID and Set-Group-ID
      Section 4.5. File Access Permissions
      Section 4.6. Ownership of New Files and Directories
      Section 4.7. access Function
      Section 4.8. umask Function
      Section 4.9. chmod and fchmod Functions
      Section 4.10. Sticky Bit
      Section 4.11. chown, fchown, and lchown Functions
      Section 4.12. File Size
      Section 4.13. File Truncation
      Section 4.14. File Systems
      Section 4.15. link, unlink, remove, and rename Functions
      Section 4.16. Symbolic Links
      Section 4.17. symlink and readlink Functions
      Section 4.18. File Times
      Section 4.19. utime Function
      Section 4.20. mkdir and rmdir Functions
      Section 4.21. Reading Directories
      Section 4.22. chdir, fchdir, and getcwd Functions
      Section 4.23. Device Special Files
      Section 4.24. Summary of File Access Permission Bits
      Section 4.25. Summary
      Exercises
      Chapter 5. Standard I/O Library
      Section 5.1. Introduction
      Section 5.2. Streams and FILE Objects
      Section 5.3. Standard Input, Standard Output, and Standard Error
      Section 5.4. Buffering
      Section 5.5. Opening a Stream
      Section 5.6. Reading and Writing a Stream
      Section 5.7. Line-at-a-Time I/O
      Section 5.8. Standard I/O Efficiency
      Section 5.9. Binary I/O
      Section 5.10. Positioning a Stream
      Section 5.11. Formatted I/O
      Section 5.12. Implementation Details
      Section 5.13. Temporary Files
      Section 5.14. Alternatives to Standard I/O
      Section 5.15. Summary
      Exercises
      Chapter 6. System Data Files and Information
      Section 6.1. Introduction
      Section 6.2. Password File
      Sectio
  • by spauldo ( 118058 ) on Tuesday July 12, 2005 @05:05PM (#13047173)
    I've got "Internetworking with TCP/IP Vol. 3 (Sockets)" that I picked up in a used bookstore for a dollar. It was written in '93 and deals with 4.3BSD - all the code examples are in K&R-style C and the API's are old, but the algorithms are there and the advice on design is very relevant.

    It's a really good book. My first network-aware programs were written using this book. There's examples for several different protocols and a deep discussion of Sun RPC. Concurrency takes a couple of chapters and ideas on server design appear throughout the book. It doesn't cover STREAMS (there was an alternate book for that) or deal with threading, but it's more than enough for most new network programmers.

    I'd highly reccommend Stevens if his other books are as useful as this one.
  • by photon317 ( 208409 ) on Tuesday July 12, 2005 @05:08PM (#13047211)
    Stevens' books are always great, and this one is no exception. I use this book regularly and I highly recommend it. But that aside, there is another shorter and somewhat overlapping book: Advanced Unix Programming: 2nd Edition [barnesandnoble.com] by Marc J. Rockhind, that I highly recommend anyone who might like the reviewed Stevens book should check out as well. Link was the only bn.com reference to it that I saw, but my copy is softcover, whereas the link appears to be hardcover.
  • by Anonymous Coward on Tuesday July 12, 2005 @05:10PM (#13047235)
    You can also buy it at Amazon: Advanced Programming in the UNIX Env, 2nd Ed. [amazon.com]
  • by Indomitus ( 578 ) on Tuesday July 12, 2005 @05:15PM (#13047303) Homepage Journal
    Are they really going to put a Dilbert cartoon on the cover? It's a funny one but the original book has kind of a classic, authoritative look to it. Putting a comic strip on the cover makes it look more like one of those jokey 'Unix in 3 hours!' books.
  • by thisissilly ( 676875 ) on Tuesday July 12, 2005 @05:24PM (#13047413)
    At least he was to me, the one time I met him at a Usenix conference, where he autographed one of his books for me.

    His books were tops in the field. Glad to hear the revised edition is still good.
  • by buckhead_buddy ( 186384 ) on Tuesday July 12, 2005 @05:31PM (#13047510)
    I'd recently read Eric Raymond's The Art of Unix Programming and having particularly enjoyed his "case studies" where he'd describe the rationale behind a file format or protocol I was looking for a book that would go into this both wider in subject area and deeper in explanation.

    A friend recommended to me the book the Advanced Unix book, and I actually saw this book last week while browsing but was hesitant to purchase it. First because the Dilbert comic strip on the front made me wary that the content was superficial. And second because the extreme length suggested that the book was probably "dumped" from PDFs, man pages, and source listings rather than "written" with insight and an analytical mindset.

    The book is a significant size so it will not fit comfortably into my lunch and bedtime reading routine, but if the binding on book of this size looks like it will physically hold up for me to read the parts that interest me then I'll likely shell out the money for it.

    Thanks for the recommendation.

  • by mrm677 ( 456727 ) on Tuesday July 12, 2005 @05:37PM (#13047584)
    As a graduate student, I really needed the original APUE book at one time but was put off by the $80 asking price (or something like that). Meanwhile, all of my Indian classmates brought their "Indian" editions with them which they acquired for insanely cheap prices. The difference is that these were often paperback and definitely were denoted as a special edition for India, but the content was the same. Very discouraging for me at the time because I had no way to acquire a discounted edition.

    • by nanoyak ( 661135 ) on Tuesday July 12, 2005 @06:05PM (#13047910) Homepage
      Yes. I bought this book in India, but I paid more along the lines of $10. It's a good idea to buy a lot of these books when you go to India. The content is the same just the paper quality is a tad different and is softcover. The book prices here are completly ridiculous.
      • by Anonymous Coward on Tuesday July 12, 2005 @06:46PM (#13048268)
        I manage a textbook department at a south-western Virginia university, and I assure you that most people in the US are pretty upset about this question of textbook prices here vs textbook prices across the pond. In fact, it is something that Congress and a special accounting office of the Feds are looking into (and have been over the last year or so). Being the cynic I am though, I think everyone is fooling themselves if they believe that textbooks in the US will ever drop to the foriegn market prices. If anything, those folks in India will start paying the US prices.

        Incidentally, it's the used book market and the blackmarket for foriegn editions that drive up the cost of new editions. Oh, and it's not your friendly college retailers fault that these prices are so sky high. The average margin on a new textbook is 20-25%, used nets around 35%. You can't sustain a multimillion dollar bookstore on that type of margin.
    • by beej ( 82035 ) on Tuesday July 12, 2005 @07:38PM (#13048788) Homepage Journal
      An Indian coworker of mine years ago would come back from his India visits with armloads of cheap computer books. $20 is on the mark.

      Besides being paperback, the quality of the binding and product overall was definitely substandard. Under heavy use, I'd expect the $80 hardcover to easily withstand more than 4x the abuse.

      But what I really really want is a frigging PDF version of this book. I'd pay $50 for it. Hear me, publishers? Think of the profits!

  • by quamaretto ( 666270 ) on Tuesday July 12, 2005 @06:03PM (#13047886) Homepage

    Advanced Unix Programming came out with a 2nd edition in 2004, and I was lucky enough to spot it in a Half Price Books [halfpricebooks.com] here in Indy. This is very similar, in terms of upgraded content.

    In particular, the test systems are the same between books. (FreeBSD, Linux, Solaris, Darwin.) Both books have grown considerably to take on the growth of Unix and the various flavors.

    Of course, AUP came out in 1985, so it had a little more turf to cover.

    For those not familiar with AUP, it is a slightly different beast from APUE. It only covers Unix system calls in C categorically, whereas APUE covers a wider range of tasks and subjects within Unix.

  • by sben ( 71467 ) on Tuesday July 12, 2005 @06:10PM (#13047963)
    the "Modem Dialer" example from the first edition has been removed

    According to the book's official site, the modem chapter was pulled from the print edition, but it was still revised, and is available as a PDF or Postscript file.

    (The site is chock full of frames, but here's the inner content page [apuebook.com] talking about it and linking to the chapter's files.)
  • by Embedded Geek ( 532893 ) on Tuesday July 12, 2005 @06:59PM (#13048414) Homepage
    Years ago I dreamt up and championed a UNIX System Programming extension class through Cal State, Fullerton. It took tons of work to develop the class, to get the department to market it, and and then finally offer it. It was a dream come true. I used Stevens APUE as the primary text.

    About three weeks into it, though, I realized I was struggling. My lectures were flat and the class really wasn't getting much out of it. I asked Paul Banks, a student who'd taken several courses with me, what I was doing wrong. "You're reading your slides, Kevin. You're not interacting with the subject matter like you usually do."

    I realized that, basically, I was intimidated as Hell by Stevens' mastery of the subject. I changed my approach. The next lecture, when there was something I couldn't entirely wrap my brain around, I tried something different. I stepped away from the lectern, sat down in the chair at the front of the class and admitted my ignorance. "I don't have direct experience on this. This is how I think this thing works. Is that how you guys read it?" Sure enough, someone in the class indicated that they'd touched on the issue in their code, but had been confused. The class came alive as my lecture became a discussion, which is my preferred mode of teaching.

    Looking back, I guess I owe that success to Stevens as much as the problem (and, yes, the problem was really between my ears, thank you very much...). His books have always been about experimentation as a means of understanding, not dictating down lessons down to the reader. If only I'd taken that tack when I started the class I could have saved myself much trouble. I'm just glad I corrected my approach and that everyone got a lot out of that class.

    Paul passed away a few years ago and I was glad that I had made a point of thanking him profusely for his advice. My only regret about the class is that I never did the same to Stevens for APUE.

  • by LizardKing ( 5245 ) on Tuesday July 12, 2005 @07:00PM (#13048424)

    Steven's APUE and Unix Network Programming are the books that turned me from a novice into someone who felt confident enough to pursue programming for a career. The first edition of APUE is so extremely well written - clear, concise and lucid. I'm definitely going to flick through the new edition, but the great thing is that the first one is still reelveant, in fact it's one of the five books I take with me to any new job.

  • by jpc ( 33615 ) on Tuesday July 12, 2005 @08:19PM (#13049123) Homepage

    Having had both editions of Unix network programming (gives me one to lend out...)

    Glad it has been updated, it seems superficially dated which might put people off, although there is actually lots of stuff thats still completely valid.
  • by Ratbert42 ( 452340 ) on Tuesday July 12, 2005 @09:40PM (#13049698)
    I can see Solaris and Linux, but FreeBSD and OSX? What about AIX and HP-UX? There are surely many more developers working on AIX and HP-UX than FreeBSD and OSX combined unless you just count PHP web-heads.
    • Re:Platforms? (Score:1, Informative)

      by Anonymous Coward on Wednesday July 13, 2005 @03:21AM (#13051169)
      PHP web-heads tend to hang out on Linux more than anything else.

      OS X has tons of developers. It has 10% of the desktop market share. It has developers.
  • I just bought the first ed last quarter for my Unix programming class, now I am going to have to go out and buy another ed just so I don't have something quite so freaking historic on my bookshelf.

All great ideas are controversial, or have been at one time.

Working...