On Wed, 13 May 2009 05:17:54 -0500 Cristi Terpea <[email protected]>
wrote:
:>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.
Not at all an expert on C, but OBTAIN cannot be called directly. It must be
invoked via an SVC instruction.
--
Binyamin Dissen <[email protected]>
http://www.dissensoftware.com
Director, Dissen Software, Bar & Grill - Israel
Should you use the mailblocks package and expect a response from me,
you should preauthorize the dissensoftware.com domain.
I very rarely bother responding to challenge/response systems,
especially those from irresponsible companies.
----------------------------------------------------------------------
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