# The "dl" Package

These routines are meant to support loading of shared objects. NOTE: THIS PACKAGE IS WORK IN PROGRESS. THE INTERFACE MAY CHANGE IN THE NEXT RELEASE, POSSIBLY WITHOUT NOTICE.

Library: karma
Link With: -lkarma

#### Functions

dl_load_object | Load shared object.
dl_symbol | Lookup a symbol in loaded object.
dl_close | Close a loaded object.

## Functions

#### EXPERIMENTAL FUNCTION: subject to change without notice

void * dl_load_object (CONST char *name, CONST char *dirs, char failed_object[STRING_LENGTH])

Load shared object.

Parameters:

- name : The name of the shared object to load (without the ".so" extension).
- dirs : An optional list of colon-separated directories in which to search for the shared object, and any other shared objects depended upon. This may be NULL.
- failed_object : The name of the object which failed to load is written here (without the ".so" extension).

Returns: A handle to the loaded object on success, else NULL.
Multithreading Level: Unsafe

#### EXPERIMENTAL FUNCTION: subject to change without notice

void * dl_symbol (void *handle, CONST char *symbol)

Lookup a symbol in loaded object.

Parameters:

- handle : A handle to the loaded object.
- symbol : The symbol to lookup.

Returns: The address where the symbol is loaded, else NULL if it is not found.
Multithreading Level: Unsafe

#### EXPERIMENTAL FUNCTION: subject to change without notice

int dl_close (void *handle)

Close a loaded object.

Parameters:

- handle : A handle to the loaded object.

Returns: 0 on success, else non-zero on error.
Multithreading Level: Unsafe

Back to Karma Home Page