mirror of
git://sourceware.org/git/glibc.git
synced 2025-04-12 14:21:18 +08:00
Move static variable cache and cachesize to toplevel.
This commit is contained in:
parent
3e4bb8d3a1
commit
9fa54c5562
@ -44,14 +44,16 @@ struct cache_file
|
||||
} 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;
|
||||
|
||||
@ -101,3 +103,19 @@ _dl_load_cache_lookup (const char *name)
|
||||
}
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user