O'Reilly logo

Advanced UNIX Programming by Warren W. Gay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Dynamic Library Loading

Most shared libraries are loaded dynamically when the program is started (on some platforms this behavior can be customized). However, when Netscape starts up, it does not know, for example, that it is going to need the Adobe Acrobat plug-in. The user does not want to wait while Netscape loads every possible plug-in at program startup. Consequently, only when Netscape has determined that it needs Adobe Acrobat support does it call on the dynamic library loader.

Opening the Shared Library

Opening a shared library causes a search for the library file to be performed. Then it is loaded into shared memory and made available for use. The function that accomplishes all of this is the dlopen(3) function:

 #include ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required