[Ecls-list] si:load-foreign-module

Juan Jose Garcia-Ripoll juanjose.garciaripoll at googlemail.com
Sun Aug 24 10:59:10 UTC 2008


On Sun, Aug 24, 2008 at 3:01 AM, Luís Oliveira <luismbo at gmail.com> wrote:
> On Sun, Aug 24, 2008 at 1:05 AM, Juan Jose Garcia-Ripoll
> <juanjose.garciaripoll at googlemail.com> wrote:
>> [...] if you load the same library with two different, but compatible
>> namestrings, then ECL will really be confused.
>
> Maybe this dlopen() flag would help?
>
>       RTLD_NOLOAD (since glibc 2.2)
>              Don't load the library.  This can be used to test if the library
>              is already resident (dlopen() returns NULL if it is not, or  the
>              library's handle if it is resident). [...]

dlopen() is not used everywhere. I have implemented a more robust
mechanism based on searching ECL's library vector for codeblock
objects which have the same handle as the one returned by
dlopen/LoadLibrary/NSFile... etc It works on my Mac and should also
work on other platforms.

	> (si::load-foreign-module "libm.dylib")
	#<codeblock "libm.dylib">
	> (si::load-foreign-module "/usr/lib/libm.dylib")
	#<codeblock "libm.dylib">

Juanjo

-- 
Instituto de Física Fundamental
CSIC, Serrano, 113, Madrid 28040 (Spain)
http://juanjose.garciaripoll.googlepages.com


More information about the ecl-devel mailing list