gtpc2m7uC/C++ Language Support User's Guide

tpf_cfdisc-Disconnect from a Coupling Facility List or Cache Structure

This function disconnects you from a coupling facility (CF) list or cache structure when you no longer require access to it. A CF list or cache structure is a named piece of storage on a CF.

Format

#include   <c$fapi.h>
int        tpf_cfdisc(struct icfdi *parms);

parms
A pointer to the tpf_cfdisc parameter list.

Normal Return

ICF_SUCCESS
Disconnecting from a CF structure on a CF is successful. The connect token is no longer valid.

Error Return

One of the following:

ICFRRCBADPARMLIST
A program error occurred because a pointer to the tpf_cfdisc parameter list is null.

Correct your program so the value is not null.

ICFRRCBADCONTOKEN
A program error occurred because the connect token specified in the tpf_cfdisc parameter list is not valid.

Correct your program to use the original connect token received in the tpf_cfconc answer area after the connection request was issued.

ICFRRCCONNINUSE
A program error occurred because the requesting processor tried to disconnect from a CF structure that was still in use.

Let all outstanding requests to the CF structure end and issue the request again.

ICFRRCRESTARTINCOMPLETE
A program error occurred because CF restart has not yet completed. Be sure to wait until CF restart is complete.

ICFRRCAUTHLOCKERROR
The disconnect request was rejected because an error prevented the CF lock from being obtained. This error occurs when the CF fails to respond to CF commands or the CF is damaged.

Programming Considerations

Applications should use the deleteCache function to discontinue use of a CF cache structure by a processor rather than using the tpf_cfdisc function.

Examples

The following example shows a normal tpf_cfdisc call. The icfdicontoken parameter that is sent is the connect token of the CF list structure to which you were connected.

#include <c$cfdi.h>
#include <c$fapi.h>
 
struct icfdi* parm_ptr = NULL;
int rc = 0;
 
crusa( 1, D4 );
parm_ptr = getcc( D4, GETCC_TYPE+GETCC_FILL, L1, 0x00 )
memcpy( &parm_ptr->icfdicontoken,
        &cf_ptr->icflt_sst1.core_str.icflt_ssctk,
        ICF_CONTOKLEN );
rc = tpf_cfdisc( parm_ptr );
if( rc != ICFRRCOK )
{
  /* ERROR, WARNING OR BAD PARM ON DISC CALL */
}

Related Information