gtpc2m4eC/C++ Language Support User's Guide

keyrc_okey-Restore Original Protection Key

This function restores the current program status word (PSW) protection key to its original value before the previous cinfc function in which the CINFC_WRITE option was specified.

Format

#include   <tpfapi.h>
void       keyrc_okey(void);

Normal Return

Void.

Error Return

Not applicable.

Programming Considerations

Examples

This example restores the original protection key of the calling function.

#include <tpfapi.h>
     .
     . /* called by an application to perform some service */
     .
     .
field_ptr = cinfc(CINFC_WRITE, CINFC_CMMINC);
     .
     . /* Can read and write protected storage to complete service */
     . /* request, cinfc has saved the callers protection key in   */
     . /* CE2OKEY. If any additional CINFC_WRITE request is issued */
     . /* it will be necessary to save the first value in CE2OKEY   */
     . /* and restore it prior to the keyrc_okey().                 */
     .
keyrc_okey();
     .
     . /* returned to callers protection key                     */
 

Related Information

cinfc-Control Program Interface.