dlfcn.cc: clear previous dl errors before new dlopen, dlsym, dlclose call?

Christopher Faylor cgf@redhat.com
Sat Feb 1 04:54:00 GMT 2003


On Tue, Jan 21, 2003 at 05:17:14PM +0800, David Huang wrote:
>Is't needed to clear previous dl errors before new dlopen, dlsym,
>dlclose call?

I don't see anything in the documentation which would indicate this.
However, the current implementation seems to be wrong since it always
returns the last load error even when called repeatedly.

SUSv3 says:

"If no dynamic linking errors have occurred since the last invocation of
dlerror(), dlerror() shall return NULL.  Thus, invoking dlerror() a
second time, immediately following a prior invocation, shall result in
NULL being returned."

So, I've modified dlerror to do just that.

Thanks for bringing this to our attention.

cgf



More information about the Cygwin-patches mailing list