Subject: Re: HEADS UP: migration to fully dynamic linked "base" system
To: None <firstname.lastname@example.org>
From: David Laight <email@example.com>
Date: 08/26/2002 21:20:03
> > No, it's not correct behavior. There's the "which global variable do
> > you use, errno or errno?" problem.
> Ooops. I realized that, and others also already pointed it out.
> errno (atleast) needs to be exported. Oh well, I stand (very) corrected on
> that. :-)
But _nd_error doesn't (on SVR4), and if the user program is only
linked with libc, but getpw* (say) is networked so dlopen() libnsl.so
the name2addr (resolv style) routines are dlopen()ed by by code in libnsl.
We now have 3 namespaces, the name2addr routines are required to
write status into the same copy of the global variable as the libnsl
code will look at. By default that doesn't happen unless the variable
exists in the program body (which it won't in this case).
The name2addr code has to do a dlsym() request with the 'handle' for
libnsl - which it can only get by dlopen()ing libnsl again.
Of course, if it was called from a different intermediary library
it won't get the right copy.
(However that did fix the cases that actually happened.)
David Laight: firstname.lastname@example.org