The C/Unix Programmer's Guide


AIX BEOS DesktopBSD FreeBSD Gentoo Linux Mac OS X
NetBSD OpenBSD PC-BSD QNX Solaris Ubuntu

Table of Contents

General
Detailed

Updates

Addendum
New Developments

Want to know more?

Some additional information about the book is available here.

Program source

The source code for all major program examples in the book is available as a tar ball. A script for compiling the programs is included. Download

Available at...

Amazon.com

Libraries

To order a copy for your library, please visit Coutts Library Service.

New Developments since Publication

When writing the C/Unix Programmer's Guide, I made every attempt to avoid printing dated material. The well-planned (and consequently stable) nature of C and Unix made this a relatively easy task. While Unix has grown immensely in recent years, the core API (Application Program Interface) has changed very little since 1999. Likewise, many new C programs and libraries have become available, but the coverage of C in the book is as accurate today as it was at the time of writing.

Nevertheless, in some cases it was essential to provide real-world data to illustrate certain ideas. Below is a discussion of some of this data, and how things have changed in recent years.

PC Hardware

Word size

At the time of writing, 64 bit processors were starting to become available. In the past few years, they have become the standard for new PCs. However, most people are still running 32 bit operating systems on these 64 bit processors, thanks to the backward compatibility built into the AMD64 architecture. Unlike previous advancements from 8 to 16 and from 16 to 32 bit processors, the 64 bit processor seems to have arrived ahead of its time.

This plays into the discussion in chapter 6 (Data Types) about choosing the proper data types. The gist of the discussion still holds true exactly as it is written. However, we now have to consider 64 bit int and long types as well. The 16 bit int will only likely be found these days on an embedded system (which may very well by running a POSIX kernel, such as QNX). In the PC world, we must take the same precautions with data types as discussed in the book, but these days it's more likely to be a choice between 32 and 64.

Lastly, if you're running a 64 bit operating system on 64 bit hardware, 64 bit integer operations can be performed with a single instruction. If you're running a 32 bit OS (even on 64 bit hardware!), then 64 bit integers will processed by multiple 32 bit instructions.

Note: The 32 bit Intel and AMD processors have supported 64 bit floating point operations for some time, including a 64 bit data bus. Hence, switching to a 64 bit OS will not have any effect on the speed of floating point intensive programs.

SCSI

The book makes mention of certain advantages of SCSI (Small Computer Standard Interface) disks over IDE (Integrated Drive Electronics). In recent years, the IDE interface has evolved into what is now known as the ATA (Advanced Technology Attachment) interface, which has many improvements, including DMA (direct memory access) I/O. As the performance gap between ATA and SCSI narrowed, the lower cost of ATA disks became the dominant factor in choosing between the two. In addition, the sie limitations of ATA disks were overcome, in part because of advancements in the PC BIOS. In short, the major disadvantages of IDE disks have been largely overcome, and the ATA interface has become clearly dominant. Mass production, among other factors, has driven the cost of ATA disks down dramatically, to the point that SCSI disks have become prohibitively expensive by comparison.

More recently, there has been a general away from parallel interfaces (such as ATA, SCSI, parallel printers, etc.) toward serial interfaces. Engineers have discovered that the physics of high speed data transfer makes it difficult to operate many parallel wires in close proximity. Each wire carrying a current generates an electromagnetic field that interferes with the signal in nearby wires. As transfer speeds get higher, so does the interference.

The result of this is new standards for communication such as USB, FireWire, and SATA (Serial ATA). The new SATA interface offers performance comparable to SCSI, using a (very inexpensive and durable) cable with only 4 wires, compared to the 80 or more used by Ultra ATA and SCSI.