diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc index 93775bed1..1fb2d62d3 100644 --- a/src/libmain/shared.cc +++ b/src/libmain/shared.cc @@ -15,9 +15,12 @@ #include #include #include +#include +#ifdef __GLIBC__ #include #include #include +#endif #include @@ -121,8 +124,10 @@ static void preloadNSS() { been loaded in the parent. So we force a lookup of an invalid domain to force the NSS machinery to load its lookup libraries in the parent before any child gets a chance to. */ std::call_once(dns_resolve_flag, []() { +#ifdef __GLIBC__ dlopen (LIBNSS_DNS_SO, RTLD_NOW); __nss_configure_lookup ("hosts", "dns"); +#endif }); }