Module Dl
Bindings to the dlopen / dlsym interface.
type library
The type of dynamic libraries, as returned by
dlopen
.
exception
DL_error of string
An error condition occurred when calling
dlopen
,dlclose
ordlsym
. The argument is the string returned by thedlerror
function.
type flag
=
|
RTLD_LAZY
|
RTLD_NOW
|
RTLD_GLOBAL
|
RTLD_LOCAL
|
RTLD_NODELETE
|
RTLD_NOLOAD
|
RTLD_DEEPBIND
Flags for
dlopen
Note for windows users: Only
RTLD_NOLOAD
andRTLD_NODELETE
are supported. Passing no or any other flags todlopen
will result in standard behaviour: just LoadLibrary is called. IfRTLD_NOLOAD
is specified and the module is not already loaded, aDL_error
with the string "library not loaded" is thrown; there is however no test, if such a library exists at all (like under linux).
val dlopen : ?filename:string -> flags:flag list -> library
Open a dynamic library.
Note for windows users: the filename must be encoded in UTF-8
val dlclose : handle:library -> unit
Close a dynamic library.
val dlsym : ?handle:library -> symbol:string -> nativeint
Look up a symbol in a dynamic library.