} libs[0];
};
+/* This is the starting address and the size of the mmap()ed file. */
+static struct cache_file *cache;
+static size_t cachesize;
+
/* Look up NAME in ld.so.cache and return the file name stored there,
or null if none is found. */
const char *
_dl_load_cache_lookup (const char *name)
{
- static struct cache_file *cache;
- static size_t cachesize;
unsigned int i;
const char *best;
}
return best;
}
+
+#ifndef MAP_COPY
+/* If the system does not support MAP_COPY we cannot leave the file open
+ all the time since this would create problems when the file is replaced.
+ Therefore we provide this function to close the file and open it again
+ once needed. */
+void
+_dl_unload_cache (void)
+{
+ if (cache != NULL && cache != (struct cache_file *) -1)
+ {
+ __munmap (cache, cachesize);
+ cache = NULL;
+ }
+}
+#endif