Add Book to My BookshelfPurchase This Book Online

Chapter 1 - Introduction to SVR4

UNIX Systems Programming for SVR4
David A. Curry
 Copyright © 1996 O'Reilly & Associates, Inc.

The BSD Source Compatibility Package
One of the transition tools provided by Solaris 2.x is the BSD Source Compatibility Package (SCP). The SCP provides many of the SunOS 4.x and BSD interfaces otherwise not included, or that differ in functionality between SunOS 4.x and Solaris 2.x. It is a collection of commands, libraries, and header files that, while they may also be present in the default Solaris 2.x environment, have different behavior between the two versions. Generally, you should be able to take a program that compiles on SunOS 4.x and compile it under the SCP with no changes to obtain a working program.
The SCP is installed in several directories:
 The /usr/ucb directory contains source compatibility package commands that existed in the /usr/ucb, /usr/bin, and /usr/etc directories under SunOS 4.x.
 The /usr/ucblib directory contains the source compatibility package libraries and SunOS 4.x/BSD system calls that are implemented as library routines in the SCP. These interfaces existed in /usr/lib under SunOS 4.x.
 The /usr/ucbinclude directory contains the source compatibility package header files, which existed in /usr/include under SunOS 4.x.
By setting your search path to include the /usr/ucb directory, or by using the /usr/ucb/cc command, you can use the SCP C compiler when you compile C programs. (The /usr/ucb/cc command is not a compiler in itself; you must still install an unbundled compiler. Rather, it is a wrapper around the C compiler that causes it to use the SCP header files and libraries.) The SCP C compiler sets its default paths to pick up the following directories, in the following order:
 User-specified include directories and libraries
 The compatibility include directories and libraries
 The base Solaris 2.x include directories and libraries, if unresolved symbols remain
Use of the BSD Source Compatibility Package, while it can help you get a program up and running in a short amount of time, is not recommended, for the following reasons:
 Programs running under the SCP suffer a performance penalty. SunOS 4.x/BSD system calls and library routines that are unavailable or have different functionality in Solaris 2.x are emulated in library routines. Although in many cases the cost of emulation is minimal, for some often-used functions the cost can be significant.
 The SCP is intended as a transition tool only, to help you port your programs from SunOS 4.x to Solaris 2.x. As Solaris 2.x matures and SunOS 4.x becomes less widespread in the UNIX community, it is likely that the SCP will be removed from future versions of Solaris 2.x.
 Many of the programming interfaces offered by Solaris 2.x are more standard than their SunOS 4.x/BSD counterparts. By changing your program to make use of these standard interfaces, the program is more portable between different versions of UNIX.
 Programs compiled with the SCP can encounter incompatibilities between the SCP and non-SCP versions of some libraries, resulting in combinations that do not produce a working program.
HP-UX 10.x and IRIX 5.x do not provide the SCP.
None of the examples in this book depend on the SCP to compile. Because the focus of this book is to help you develop new programs in the SVR4 environment and to help you port your existing programs to SVR4, this book will not discuss the SCP further.

Previous SectionNext Section
Books24x7.com, Inc © 2000 –  Feedback