Subject: Re: Linux & DLLs
From: (Adam J. Richter)
Date: Fri, 20 Sep 1996 19:42:38 -0700 (PDT)

>>	"man dlopen"

>Thanks for correcting my ignorance.  (How would I have known that this was
>the name of the facility, by the way?  "man -k ELF" produced nothing

	That is a reasonable question.  The resource that we recommend
for reference is the book that we publish, _The Linux Bible_, which is a
compilation of free Linux documentation, most of which is "The Linux
Documentation Project."

	As an experiment, I tried the CD-ROM in the third edition of the
Linux Bible and the CD-ROM in the new fourth edition (the first and
second editions did not have CD-ROM's).  Each Linux Bible CD has a cute
little hypertext browser and search engine capabilities (entirely free
software, of course: freeWAIS and lynx).  One of the document collections
that this system can search is the manual pages.  I tried a search for
"dynamically loadable library" against the manual pages with this system.
Both the third and fourth edition CD's turned up a large number of hits,
including the manual pages for dlopen, dlclose, dlerror, and so on.
In the third edition, the first of these was listed #6 on the hit list,
and in the fourth edition, the first was #80.

	If you have the Linux Bible you can try this yourself.  Just
mount the CDROM on /mnt and type:

		cd /mnt

	...and then do a "readbible" or "ReadBible", depending on
which version of the Linux Bible you have (the install program will
tell you which command).

>Aside from the fact that the dlopen interface is defined with the
>common Unix botch that makes it not multi-threadable, it's exactly what I
>was looking for.

	I assume you are referring to the dlerror() function.
It is possible to produce a thread-safe implementation that
simply stores the error on a per-thread basis and has dlerror
look up what thread it is.  However, I concede that it would
have been much better to have the error code returned by the
routine that generated the error.  No doubt this inelegance is due
to the fact that dlopen() is an interface that Linux cloned from the
proprietary software world (Solaris). :-)

Adam J. Richter				  Yggdrasil Computing, Incorporated
(408) 261-6630				  "Free Software For The Rest of Us."