gtpc2m33C/C++ Language Support User's Guide

flushCache-Flush the Cache Contents

This function flushes the contents of the cache.

Format

#include  <c$cach.h>
long       flushCache(const cacheToken *cache_to_flush);

cache_to_flush
The returned cache_token from the newCache function that defined the logical record cache.

Normal Return

CACHE_SUCCESS
The function is completed successfully.

Error Return

CACHE_ERROR_HANDLE
The cache_token provided for the cache_to_flush parameter is not valid.

Programming Considerations

The flush occurs immediately and without regard for any other applications that may also be using the cache.

Examples

The following example flushes the contents of the file system INODE cache.

#include <c$cach.h>
#include <i$glue.h>
 
    struct icontrol * contrl_ptr;      /* pointer file system control area */
 
/*  get pointer to file system control area                               */
 
    contrl_ptr = cinfc_fast_ss(CINFC_CMMZERO,
                  ecbptr()->ce1dbi );
 
/*  if using INODE cache, call to flush INODE cache */
 
    if (contrl_ptr->icontrol_icacheToken.token1 != 0)
         flushCache(&contrl_ptr->icontrol_icacheToken);
 

Related Information