Advanced UNIX Programming (2nd Edition) and over one million other books are available for Amazon Kindle. Learn more

Vous voulez voir cette page en français ? Cliquez ici.

Have one to sell? Sell yours here
Start reading Advanced UNIX Programming (2nd Edition) on your Kindle in under a minute.

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Advanced Unix Programming [Paperback]

Marc J. Rochkind , Rochkind
4.8 out of 5 stars  See all reviews (12 customer reviews)

Available from these sellers.


Amazon Price New from Used from
Kindle Edition CDN $18.62  
Hardcover --  
Paperback CDN $19.60  
Paperback, January 1987 --  
There is a newer edition of this item:
Advanced UNIX Programming (2nd Edition) Advanced UNIX Programming (2nd Edition) 4.8 out of 5 stars (12)
CDN$ 42.83
In Stock.
Join Amazon Student in Canada

Book Description

January 1987
The value of this book lies in its ability to draw out the UNIX systems magnificent blend of simplicity and power - the strengths, weaknesses, and underlying rationale contained in each UNIX design feature. Shows how, when, and why system calls are used in important UNIX versions to interface user subroutines and commands with Kernel facilities. Now systems programmers, software engineers, and C/UNIX users can cover UNIX system calls easily and portable with this complete, detailed, how-to reference.

Customers Who Bought This Item Also Bought

Product Details

Product Description

From the Publisher

A comprehensive examination of UNIX® system calls--the interface between user programs and the kernel.

From the Inside Flap


This book updates the 1985 edition of Advanced UNIX Programming to cover a few changes that have occurred in the last eighteen years. Well, maybe "few" isn't the right word! And "updates" isn't right either. Indeed, aside from a sentence here and there, this book is all new. The first edition included about 70 system calls; this one includes about 300. And none of the UNIX standards and imple-mentations discussed in this book--POSIX, Solaris, Linux, FreeBSD, and Darwin (Mac OS X)--were even around in 1985. A few sentences from the 1985 Preface, however, are among those that I can leave almost unchanged:The subject of this book is UNIX system calls--the interface between the UNIX kernel and the user programs that run on top of it. Those who interact only with commands, like the shell, text editors, and other application programs, may have little need to know much about system calls, but a thorough knowledge of them is essential for UNIX programmers. System calls are the only way to access kernel facilities such as the file system, the multitasking mechanisms, and the interprocess communication primitives.

System calls define what UNIX is. Everything else--subroutines and commands--is built on this foundation. While the novelty of many of these higher-level programs has been responsi-ble for much of UNIX's renown, they could as well have been programmed on any modern operating system. When one describes UNIX as elegant, simple, efficient, reliable, and porta-ble, one is referring not to the commands (some of which are none of these things), but to the kernel.That's all still true, except that, regrettably, the programming interface to the ker-nel is no longer elegant or simple. In fact, because UNIX development has splintered into many directions over the last couple of decades, and because the principal standards organization, The Open Group, sweeps up almost everything that's out there (1108 functions altogether), the interface is clumsy, inconsistent, redundant, error-prone, and confusing. But it's still efficient, reliably imple-mented, and portable, and that's why UNIX and UNIX-like systems are so successful. Indeed, the UNIX system-call interface is the only widely imple-mented portable one we have and are likely to have in our lifetime.

To sort things out, it's not enough to have complete documentation, just as the Yellow Pages isn't enough to find a good restaurant or hotel. You need a guide that tells you what's good and bad, not just what exists. That's the purpose of this book, and why it's different from most other UNIX programming books. I tell you not only how to use the system calls, but also which ones to stay away from because they're unnecessary, obsolete, improperly implemented, or just plain poorly designed.

Here's how I decided what to include in this book: I started with the 1108 func-tions defined in Version 3 of the Single UNIX Specification and eliminated about 590 Standard C and other library functions that aren't at the kernel-interface level, about 90 POSIX Threads functions (keeping a dozen of the most important), about 25 accounting and logging functions, about 50 tracing functions, about 15 obscure and obsolete functions, and about 40 functions for scheduling and other things that didn't seem to be generally useful. That left exactly 307 for this book. (See Appendix D for a list.) Not that the 307 are all good--some of them are use-less, or even dangerous. But those 307 are the ones you need to know.

This book doesn't cover kernel implementation (other than some basics), writing device drivers, C programming (except indirectly), UNIX commands (shell, vi, emacs, etc.), or system administration.

There are nine chapters: Fundamental Concepts, Basic File I/O, Advanced File I/O, Terminal I/O, Processes and Threads, Basic Interprocess Communication, Advanced Interprocess Communication, Networking and Sockets, and Signals and Timers. Read all of Chapter 1, but then feel free to skip around. There are lots of cross-references to keep you from getting lost.

Like the first edition, this new book includes thousands of lines of example code, most of which are from realistic, if simplified, applications such as a shell, a full- screen menu system, a Web server, and a real-time output recorder. The examples are all in C, but I've provided interfaces in Appendices B and C so you can pro-gram in C++, Java, or Jython (a variant of Python) if you like.

The text and example code are just resources; you really learn UNIX program-ming by doing it. To give you something to do, I've included exercises at the end of each chapter. They range in difficulty from questions that can be answered in a few sentences to simple programming problems to semester-long projects.I used four UNIX systems for nuts-and-bolts research and to test the examples: Solaris 8, SuSE Linux 8 (2.4 kernel), FreeBSD 4.6, and Darwin (the Mac OS X kernel) 6.8. I kept the source on the FreeBSD system, mounted on the others with NFS or Samba.

I edited the code with TextPad on a Windows system and accessed the four test systems with Telnet or SSH (PuTTY) or with the X Window System (XFree86 and Cygwin). Having the text editor and the four Telnet/SSH/Xterm windows open on the same screen turned out to be incredibly convenient, because it takes only a few minutes to write some code and check it out on the four systems. In*addition, I usually had one browser window open to the Single UNIX Specifi-cation and one to Google, and another window running Microsoft Word for editing the book. With the exception of Word, which is terrible for big documents like books (crashes, mixed-up styles, weak cross-referencing, flakey document- assembly), all of these tools worked great. I used Perl and Python for various things like extracting code samples and maintaining the database of system calls.

--This text refers to an alternate Paperback edition.

Customer Reviews

3 star
2 star
1 star
4.8 out of 5 stars
4.8 out of 5 stars
Most helpful customer reviews
4.0 out of 5 stars Technical excellence; worth owning July 7 2004
(reviewed for the Calgary Linux Users Group Guild)
There is a saying which goes, "UNIX is user-friendly; it's just picky about who its friends are." Upon reading Advanced UNIX Programming, I get the impression that Marc Rochkind may at one time have been a close friend of UNIX, but having become a little disillusioned by what UNIX has become in the 19 years since his first edition, is willing to settle for being a calm, professional acquaintance. His opening chapter provides two main reasons why this has happened: first, the UNIX kernel has grown from providing 70 or so system calls, to over 600 for an implementation that provides Single UNIX Specification and POSIX compliance; and second, there are so many flavours of UNIX out there (including Linux) that none of them implement exactly the same set of system calls. Thus the increasing complexity and diversity of UNIX implementations makes it difficult to know all that can be called UNIX intimately. Rochkind's book presents enough material to make the reader an acquaintance, leaving the building of a friendship as an exercise for the highly committed.
Rochkind makes a careful selection of just over 300 of the most important system calls and groups them into a handful of broad topics: I/O (file and terminal), processes and threads, inter-process communication (including sockets), signals, and timers. He takes great care to highlight what is available in Solaris (version 8), Linux (SuSE 8), BSD (FreeBSD 4.6), and Darwin (6.8; MacOS 10.2.8), and how to write something that has a hope of running on all of them. The system calls he describes are the ones anyone writing UNIX applications must know about. That is his target audience, and he meets that target squarely.
Read more ›
Was this review helpful to you?
4.0 out of 5 stars Finally - Very Updated! May 23 2004
In 1987, I encountered the first edition of Rochkind's book. Grew to depend on it as an authoritative discourse on serious unix interprocess programming. Now (finally!) he has issued an updated edition. (Has it really been 19 years?)
What is different? Much. Indeed, most of the book. In the first chapter, he summarises myriad developments in the unix world and, of course, the rise of linux. He writes for all the current unix variations and linux.
Since 1985, there has been a plethora of different interprocess communications methods. So the chapters on these form a prominent part of the book. Then, naturally, in the networking chapter, who can ignore the web? So Rochkind gives a concise detour into http, with example code for a simple browser and web server.
One thing unchanged from the first edition is the well deserved use of "Advanced" in the title. The treatment is sophisticated and, frankly, not an easy read for someone new to the subject. Rochkind writes well, but you do have to concentrate. He goes at a pace that at a very minimum assumes you are already facile in C and with using unix at the user level. The source code examples are simple, once you grasp the concepts.
The problems he furnishes in each chapter can be extremely useful if you want to deepen your understanding. The questions are nontrivial and usually expand on salient points discussed in the chapters. If you are indeed new to all this, you should make a serious attempt at the problems.
Was this review helpful to you?
My first two books about Unix Programming were "The Unix Programming Environment" by Kernighan and this book. Both are outdated, because when they were written there was no POSIX, XPG3 or ANSI C standards around.
Kernighan's book is ideal for Unix beginner's and offers a friendly general introduction to Unix programming and also covers shell programming very well. Rochkind's book details the basic Unix system calls and libraries.
I think that this book is still valuable and can be used as a fast course about old-style Unix programming. The best book on this subject is "Advanced Programming in Unix Environment" by Richard Stevens, that is well written, updated and covers much more topics, but takes a lot of time to read.
My favorite part is when Rochkind comments the source code of a mini-shell that can help you understand the mechanism of a real Unix shell.
But notice, Unix Network Programming isn't covered here.
Was this review helpful to you?
5.0 out of 5 stars Highly Informative May 31 2000
By A Customer
You should be familiar with general UNIX commands and the UNIX OS. This text will take you help you take advantages of the UNIX system. A lot of complex ideas are set forth. I highly recommend reading this book in between watching "Takin It All Off" and "Bikini Car Wash" videos, both of which are available through VHS video department. The analytical aspects of this book are both analytical and very aspecty. Two things I look for in a computer-based book. If you are having difficulty with this text, then get a beginning text on UNIX, like "UNIX for Dummies".
Was this review helpful to you?
5.0 out of 5 stars A must-have book for UNIX system call programming Sept. 23 1998
The author knew the original developers of UNIX, and it shows in the quality of the information in the book. Also the writing style and the contents are both very good indeed - to the point, yet detailed where needed. Has examples on basic system calls for file and process management, terminal I/O, IPC, etc. Each chapter ends with a section on portability between various flavors of UNIX. Uses an example of a creating a simple DBMS to illustrate many of the topics. BYTE magazine gave it a very good review. Buy it !
Was this review helpful to you?
Want to see more reviews on this item?
Most recent customer reviews
5.0 out of 5 stars A must have
I also have the first edition (and a previous book) and am an unabashed fan of Marc Rochkind's.
What this book promises and delivers is a catalog and explanation of Unix... Read more
Published on May 17 2004 by P.Hertel
5.0 out of 5 stars The Other Reviews Are OLD
The reviews posted under this title refer to the first edition of this book.
This is the long awaited and updated second edition which isn't even in the stores yet! Read more
Published on April 30 2004 by P.Hertel
5.0 out of 5 stars Gotta have it when you start pgmming in Unix
A must have, must have, must have
Published on Sept. 16 1999
5.0 out of 5 stars one of the two most useful books on unix
One of the two most useful books on unix (another one is "The Unix Programming Environment").
Published on Sept. 16 1999 by Does Not Matter
5.0 out of 5 stars Covers System calls indepth, a must for hardcore unix fans.
A very rare book with useful information about unix system calls, helps you acquire indepth knowledge about interprocess communication and unix file management system. Read more
Published on March 20 1999
5.0 out of 5 stars A must-have for understanding Interprocess Communication
An excellent book for people who want to understand and program under UNIX operating system. The author has done a wonderful job by building a set of library routines for... Read more
Published on Dec 28 1998 by
4.0 out of 5 stars Very good starter book
I found this book an excellent introduction when I first started doing network programming, sockets, signals, and threads in a Unix environment. Read more
Published on Oct. 27 1998 by Paul Tomblin
Search Customer Reviews
Only search this product's reviews

Look for similar items by category