Hi

I think you got this not in OBTAIN , but memcpy as dsname already a pointer.
If I correct this:
- I got the Fetched message
- a S0C2 i(priv op exception) in OBTAIN

Cristi Terpea 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.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html



--
Miklos Szigetvari

Development Team
ISIS Information Systems Gmbh tel: (+43) 2236 27551 570 Fax: (+43) 2236 21081 E-mail: miklos.szigetv...@isis-papyrus.com Info: i...@isis-papyrus.com Hotline: +43-2236-27551-111 Visit our Website: http://www.isis-papyrus.com ---------------------------------------------------------------
This e-mail is only intended for the recipient and not legally
binding. Unauthorised use, publication, reproduction or
disclosure of the content of this e-mail is not permitted.
This email has been checked for known viruses, but ISIS accepts
no responsibility for malicious or inappropriate content.
---------------------------------------------------------------
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to