Example Code in This Book

Even more challenging than having uniform man page references is the creation of example programs that would compile for all UNIX platforms. While this could be attempted, it has the danger that it would not be universally successful unless the code was tested on every platform. Even then, pitfalls abound, because there exist many different choices in compilers, libraries, and other customizable aspects of the UNIX platform.

The examples in this book have tried to be UNIX platform neutral. Practical considerations, however, made it necessary to pick one development platform for the examples. The major differences are addressed in the text as they come up. Look for additional tips, warnings, and notes for other UNIX differences that may be worth noting.

The challenges of supporting multiple UNIX platform differences include the following:

  • Subtle differences in the different make(1) commands

  • Differences in the feature set macros required to compile the programs

  • Differences in location of the include files

  • Differences in function prototype definitions

  • Differences in C data types (int vs. size_t)

To deal with all of these problems would end up leaving the reader with a rat's nest of ugly source code to look at. Rather than give you difficult-to-read source code and complicated make(1) procedures, this book will simply use the FreeBSD Release 3.4 platform as the foundation for all program examples. Important differences in compilers and other areas will be noted along the way.

This approach provides the professional the advantage that learning can take place at home. FreeBSD is a stable and secure platform that can be loaded onto just about any reasonable Intel PC. Yet it remains very similar to many commercial UNIX platforms in the workplace.

Note

While FreeBSD can be installed with many useful Linux enhancements, the FreeBSD 3.4 Release used for the examples in this book did not have any Linux support installed. This was intentionally done to present a more traditional UNIX experience.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.249.105