deleteCache: Delete a logical record cache

This function deletes a logical record cache from the processor.

Last updated

  • Changed in 2022.
  • Changed in 2019.

Format

#include   <tpf/c_cach.h>
int        deleteCache(cacheToken *cache_to_release);
cache_to_release
The cache token for the logical record cache to be deleted.

Normal return

CACHE_SUCCESS
The function is completed successfully.

Error return

CACHE_ERROR_HANDLE
The cache_token provided for the cache_to_release parameter is not valid.
CACHE_ERROR_NOTALLOWED
The cache_token that is provided for the cache_to_release parameter refers to a cache that was created by using the ZCACH CREATE command. You must use the ZCACH DELETE command to delete the cache.

Programming considerations

  • The delete occurs immediately and without regard for other applications that might also be using the cache.
  • After this function is called, the memory area that is associated with the cache_to_release parameter is set to zeros.
  • Use this function to delete logical record caches that are created by using the newCache and tpf_newCache_ext functions. You cannot use this function to delete logical record caches that are created by using the ZCACH CREATE command.
  • Use the newCache, tpf_newCache_ext, or tpf_cacheNameToToken function to retrieve a logical record cache token.
  • For more information about when caches are re-created and reattached after an IPL, see Logical record cache IPL considerations.

Examples

The following example deletes a cache that is named MYCACHE.
#include <tpf/c_cach.h>

cacheToken cacheToken;
int        rc;

// Retrieve the cache token.
rc = tpf_cacheNameToToken("MYCACHE", &cacheToken);
if (rc != CACHE_SUCCESS)
{
  printf(“tpf_cacheNameToToken() returned unexpected return code %d\n”, rc);
  exit(0);
}

// Delete the cache.
rc = deleteCache(&cacheToken);
if (rc != CACHE_SUCCESS)
{
  printf(“deleteCache() returned unexpected return code %d\n”, rc);
}