Re: very slow start of mc (4.6.0) on FreeBSD5.1-Release

>>>>> "Philipp" == Philipp Thomas <pthomas suse de> writes:
Philipp> * Rob Ristroph (rgr sdf lonestar org) [20030702 20:21]:
>> Perhaps in a future version of my floppy I might change mc to not
>> call gethostbyname() if it can't find that library; if so I will
>> submit a patch.
Philipp> When any of the resolving functions like gethostbyname from
Philipp> glibc are called, glibc in turn will call the necessary
Philipp> libnss modules, based on what's configured in
Philipp> /etc/nsswitch.conf. So mc *can't* detect whether or not the
Philipp> libnss modules are present.
Philipp> Compiling a statically linked mc is also out of the question
Philipp> because the libnss* modules are always loaded dynamically,
Philipp> making the program only semi-static (rpm for instance has
Philipp> this problem). So on an ELF system that uses glibc 2.X, you
Philipp> can't call *any* of the resolving functions if you want to
Philipp> have a true statically linked program. Work is underway for
Philipp> future versions of glibc to make the linker issue errors in
Philipp> case this is tried.
Philipp> So your only choice would be to either compile your own mc
Philipp> with all getXbyY calls removed or put only
Philipp> together with a suitable /etc/nsswitch.conf on your floppy.
Philipp> Philipp

This explanation clears up a lot for me.  I had presumed it was mc
that was doing the manual loading of the file -- I had run strace and
seen the dlopen("/lib/libnss_<something>.so") call.  

I will most likely continue to use the official mc, but squeeze the
libnss stuff on the floppy somehow.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]