Andreas Mohr wrote:
> On Mon, Jan 01, 2001 at 11:39:41PM -0500, James Abbatiello wrote:
>
>> Might something like the attached work? It doesn't break 2.1.2, and
>> keeps the hacks isolated to library/port.c. Andreas?
>>
>> diff -u -r1.8 port.c
>> --- library/port.c 2000/12/19 19:38:48 1.8
>> +++ library/port.c 2001/01/02 04:04:55
>> @@ -452,6 +452,8 @@
>> #ifdef HAVE_DL_API
>> void *ret;
>> char *s;
>> + static void *dummy = NULL;
>> + if (!dummy) dummy = dlopen( NULL, RTLD_LAZY );
>> dlerror(); dlerror();
>> ret = dlopen( filename, flag );
>> s = dlerror();
>
>
> You don't really want to do that.
> That way you have to do that check *every* time you call that function.
> Much better to do it once upon startup (somewhere in that file preferrably),
> IMHO.
Yes, you'd have to do the check every time. But one simple comparision
would seem to be insignificant compared to the time the actual dlopen()
would take to load the library. Not to mention the 4 calls to dlerror()
that we've already added to compensate for glibc. Even those alone
should greatly outweigh the time this check takes. And I'm working
under the assumption that dlopen() isn't a particularly time-critical
function. Does it work though?
--
James Abbatiello