Lines Matching defs:cache
4247 * Function to maintain a file descriptor cache, so that doio does not have
4249 * cache by file name, and open flags. Each entry also has a _rtc value
4252 * the one in the cache that has the oldest _rtc value.
4255 * in the cache, and free the memory in the cache.
4275 static struct fd_cache *cache = NULL;
4281 * If file is NULL, it means to free up the fd cache.
4284 if (file == NULL && cache != NULL) {
4285 for (cp = cache; cp < &cache[cache_size]; cp++) {
4296 free(cache);
4297 cache = NULL;
4306 * Look for a fd in the cache. If one is found, return it directly.
4308 * oldest fd slot in the cache, and free_slot will point to an
4312 for (cp = cache; cp != NULL && cp < &cache[cache_size]; cp++) {
4336 * No matching file/oflags pair was found in the cache. Attempt to
4352 * Close the oldest one in the cache (pointed to by
4374 * we need to grow the cache, otherwise free_slot is the slot that
4379 cache =
4380 (struct fd_cache *)realloc(cache,
4383 if (cache == NULL) {
4392 for (cp = &cache[cache_size - FD_ALLOC_INCR];
4393 cp < &cache[cache_size]; cp++) {
4397 free_slot = &cache[cache_size - FD_ALLOC_INCR];
4401 * finally, fill in the cache slot info