module Dl:sig
..end
type
library
Dl.dlopen
.exception DL_error of string
Dl.dlopen
, Dl.dlclose
or
Dl.dlsym
. The argument is the string returned by the dlerror
function.type
flag =
| |
RTLD_LAZY |
| |
RTLD_NOW |
| |
RTLD_GLOBAL |
| |
RTLD_LOCAL |
| |
RTLD_NODELETE |
| |
RTLD_NOLOAD |
| |
RTLD_DEEPBIND |
Dl.dlopen
Note for windows users: Only RTLD_NOLOAD
and RTLD_NODELETE
are supported.
Passing no or any other flags to Dl.dlopen
will result in standard behaviour:
just LoadLibrary is called. If RTLD_NOLOAD
is specified and the module is
not already loaded, a Dl.DL_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
Note for windows users: the filename must be encoded in UTF-8
val dlclose : handle:library -> unit
val dlsym : ?handle:library -> symbol:string -> nativeint