May 3, 2004

The Importance of Linux

Author: Preston St. Pierre

Of course readers of a book learn from it, but authors learn from writing it, too. One of the most surprising things I learned from writing the second edition of Advanced UNIX Programming was how good Linux really is.

Some personal history: I first encountered UNIX when it was a toddler, in 1972, while I was at Bell Labs, where it originated. Much later, like many programmers who had long experience with the real thing, I was pretty skeptical about Linux. It wasn't the first UNIX clone I'd looked at. In fact, I wrote a review for a UNIX-like system called Coherent that appeared in a 1985 issue of BYTE magazine. I concluded that Coherent was a fairly faithful clone as far as system calls went (commands were less similar), but didn't seem to be of industrial strength like real UNIX System III was.

AT&Tderived UNIX systems were ubiquitous throughout the late 1980s and early 1990s, and so I didn't pay much attention to clones. Besides, hardware was expensive, so the fees AT&T charged for each binary didn't affect the total cost much. Like most people, I didn't even notice when Coherent and other clones, like Idris, eventually faded away.

I next heard about a non-AT&T UNIX system around 1990 or 1991, when I met some people at a Usenix conference who were working with a version of BSD UNIX that had been purged of AT&T code. At that time this was mainly an academic effort there wasn't yet anything you could run on a cheap Intel-based PC. I also knew that a long-term goal of the GNU project was to have a complete OS, although in the early 1990s they were still focused on commands and compilers.

Then Linux came along. I don't remember when I first heard of it, but I do remember that it was more of a curiosity than a serious system. A group of programmers I was managing around 1998 ported our fairly complicated system to Linux as an experiment, and I was as amazed and pleased as they were, but, as the chances of our customers running Linux were close to zero, we didn't try to release that port.

Even when I started fooling around with Linux about three years ago, and became aware about real-world installations like Google, I didn't realize how well done Linux was, because I was only looking at it as a user, not as a systems programmer.

But updating the book, which I started in summer 2002, forced me to go deeper. I started with FreeBSD and SuSE Linux systems running on two spare desktop boxes. Then I bought another box to run Solaris, and finally added a Macintosh to run OS X, which has a UNIX kernel (Darwin). The book contains about 18,000 lines of example code (free download at covering about 300 system calls, and I wanted to test all the examples on all four systems. How would Linux stack up against the other three systems, each of which was derived in some way from genuine AT&T UNIX?

Amazingly well, as it turned out. True, the Linux I used was well behind Solaris in conforming to the latest UNIX standard, lacking POSIX interprocess communication, POSIX threads, and a few other system calls, but what was there was solid, complete, and, especially, efficient. Linux, as I discovered, is no academic exercise it's targeted at the most critical industrial applications. What's more, even as I was writing the book, Linux kept evolving. It now has POSIX threads, for example. (My two other test systems, FreeBSD and Darwin, were and continue to be less complete than Linux, I suppose because their development communities are smaller and less well-funded.)

Commercially, we know Linux is having a big impact, judging from the news articles about SCO's litigation, Sun's decline, and Microsoft's jitters. But what's the importance of Linux technically and socially? It's this:

  • Unlike other UNIX clones, Linux and the BSD-derived systems (including Darwin) are open source, which means not only that users can have the source if they want it, but also that vendors who improve the source, like Red Hat, have to share their improvements. Users can choose to be entirely self-sufficient, compiling and building their own kernel. Or, they can use a commercial distribution, and still have the option of building their own. Students and ambitious professionals can learn how a real OS is put together.
  • Alone among open-source OSes, Linux has achieved critical mass. It's a strategic platform for big hardware and software vendors like Oracle, HP, and IBM. There are thriving Linux vendors like Red Hat and SuSE (now part of Novell). There are big users, although many of them are lying low these days, hoping to evade SCO's radar. Perhaps the most convincing evidence that Linux has arrived is that Wal-Mart sells it.
  • Linux really can substitute for UNIX, as I proved in doing the research for my book. It's irritating that it doesn't conform more closely to the Single UNIX Specification (see for details), but the gaps are on the surface and could be closed in a few months if the Linux community wanted to spend the time.
  • Linux is having a dramatic effect on the balance of power between vendors and between users and vendors. Having tasted open source, users are demanding more from closed-source vendors like Microsoft and Sun. Once invulnerable vendors, notably Microsoft, are looking over their shoulders as Linux gains server share and even threatens to invade the corporate desktop.
  • Linux is perfect for developing countries, because they can use it to educate their knowledge workers, they can deploy it without spending cash or running afoul of intellectual-property agreements, and they can become self-sufficient rather than being dependent on US and European technology companies.

To think: All of this from Linus Torvald's little attempt to turn Minix (an UNIX-inspired educational OS) into something more real and exciting. It shows what happens when the right solution collides with the right problem.

Contest details:

To acknowledge proud owners of the First Edition of Advanced UNIX Programming which published in 1985 publisher Addison-Wesley will award the first 19 respondents (1 book for each intervening year) who correctly answer the below questions, with a complimentary copy of the new book. Respondents should reply to Heather Fox at

  1. Which version of UNIX was used to test the example code in the book?
  2. What was the last system call introduced in the book?
  3. Which of the following UNIX systems was NOT discussed in the book? a)
    Idris b) AT&T System IV c) Xenix

Editor's note: Following this article, we will be publishing excerpts of Rochkind's Advanced UNIX Programming.

Click Here!