JuliaLang/julia — pull request #2380 by stevengj (2013-02-21 03:59:18+00:00)
Title: add optional RTLD flags argument to dlopen, fixes issue #2312

As a more general alternative to my #2317 patch (to fix #2312), this patch makes *all* `dlopen` flags available in Julia: it adds an optional argument `dlopen(libfile::String [, flags::Integer])` where the second argument is a bitwise-or of RTLD flags, which defaults to `RTLD_LAZY|RTLD_DEEPBIND`.

So, a library can be opened global access via `dlopen(libfile, RTLD_LAZY|RTLD_DEEPBIND|RTLD_GLOBAL)`.

Note that if a flag is not supported on the running platform (e.g. Windows), it is simply ignored.