Installation guide
8
Postmigration Programming Features
After you migrate your source code from an ULTRIX to a DIGITAL UNIX
system, you might want to enhance it by using features of the DIGITAL
UNIX system. This chapter gives an overview of using three DIGITAL
UNIX features: shared libraries, semaphores, and the number of open file
descriptors.
For complete information on using DIGITAL UNIX features, see the
Programmer’s Guide.
8.1 Using Shared Libraries
Shared libraries allow several applications to use a single copy of a library
routine at run time. Shared libraries help save disk space and memory, and
they can improve the performance of your application and system.
Using DIGITAL UNIX shared libraries is similar to using archive libraries.
To link your application with a shared library, you must have compiled it
on a DIGITAL UNIX system. Therefore, you must recompile and relink
ULTRIX applications if you want them to use shared libraries.
This section describes how to use the cc command to link with a shared
library. It also describes how to create shared libraries.
For complete information about using shared libraries, see the
Programmer’s Guide.
8.1.1 Linking with Shared Libraries
On DIGITAL UNIX systems, the cc command links your application with
shared libraries by default. The following example shows the command you
enter to link with the shared version of libc:
% cc -o hello hello.c
This command creates an executable file named a.out, which you run.
You can also link your application with a shared library that you create.
For example, suppose you create a shared library named
libspecial_math.so and store that library in the directory
Postmigration Programming Features 8–1