Using the __amrc2 structure

The __amrc2 structure is an extension of __amrc. Only 2 fields are defined for __amrc2. Like the __amrc structure, __amrc2 is changed during system I/O and some C specific error situations. Figure 1 shows the __amrc2 structure as it appears in stdio.h.

Note: See Using the SIGIOERR signal for information on restrictions that exist when comparing file pointers if you are using the __amrc2 structure.
Figure 1. __amrc2 structure
    struct {
        int       __error2;     1                */
        FILE          *__fileptr;    2           */
        int       __reserved[6];
    }
 1 
This field is a secondary error code that is used to store the reason code from specific macros. The __last_op codes that can be returned to __amrc2 are __BSAM_STOW, __BSAM_BLDL, __IO_LOCATE, __IO_RENAME, __IO_CATALOG and __IO_UNCATALOG. For information on the macros associated with these codes, see Table 1. For more information about the macros, see z/OS DFSMSdfp Diagnosis.
 2 
This field, __fileptr, of the __amrc2 structure is used by the signal SIGIOERR to pass back a FILE pointer that can then be passed to fldata() to get the name of the file causing the error. The __amrc2__fileptr will be NULL if a SIGIOERR is raised before the file has been successfully opened.