I'm trying to call OBTAIN by fetching IGC0002G and executing but keep
getting errors.
This is the code I'm using:
int main (int argc, char *argv[]) {
typedef int OBTAIN(char* ,char*, char*);
#pragma linkage(OBTAIN, OS)
OBTAIN *OBTAIN_FN;
char dsname[44], volume[6];
char search_work_area[140];
int rc = -1;
memset(&dsname,' ',44);
memcpy(&dsname, "IBMUSER.TESTUP", 14);
memset(&volume,' ', 6);
memcpy(&volume, "S6SYS1", 6);
memset(&search_work_area, 0, 140);
OBTAIN_FN = (OBTAIN *) fetch("IGC0002G");
printf("Fetched %x\n", OBTAIN_FN);
rc = OBTAIN_FN(dsname, volume, search_work_area);
printf("Result: %d\n", rc);
return 0;
}
Fetched 1163fd00
Segmentation fault
and the error I'm getting:
CEE3204S The system detected a protection exception (System Completion
Code=0C4).
From entry point main at compile unit offset +00000150 at entry
offset +00000150 at address 11608A68.
CEE3204S The system detected a protection exception (System Completion
Code=0C4).
From entry point main at compile unit offset +00000150 at entry
offset +00000150 at address 11608A68.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html