I am not secure enough in my C skills to say "here is exactly how to do it" but
I think I have something relevant that may get you close at least. Here is how
I load and call BPXWDYN. It's C++, so that is another wrinkle.
extern "OS" typedef int External_Function(char *, ...) ;
static External_Function *bpxwdyn;
bpxwdyn = (External_Function *)fetch("BPXWDYN");
if ( bpxwdyn == NULL )
{
throw Critical_Error("Unable to load bpxwdyn");
}
int rc = (bpxwdyn)(allocString, &ret_DD, &ret_msg_req, &ret_msgs[0],
&ret_msgs[1], &ret_msgs[2], &ret_msgs[3]);
HTH. Feel free to follow up.
Charles
On Wed, 3 Sep 2025 17:45:29 -0500, Eric Erickson <[email protected]> wrote:
>On some work we are doing we don't want to have to link IGGCSI00 (Catalog
>Services Interface) into our C program. We have an assembler routine that will
>load the routine and pass back the address to the caller and I have verified
>that the function pointer now points to the requested module. But when I call
>it, I get a S0c4 which I'm pretty sure because the parameter list is not in OS
>format, its C based.
>
>Now my dilemma is to specify that the calling convention for this function
>pointer is OS and not C.
>
>I can not figure out how to code the #pragma linkage(?????, OS).
>
>This is the definition for the function pointer.
>
>int (*pIggCsi00)(PARM1, PARM2, PARM3);
>
>Here is the call to do the load.
>
>int fnLoadModule("IGGCSI00", (void(**)()) &pIggCsi00));
>
>On return from the load routine pIggCsi00 definitely points to IGGCSI00.
>
>The call to the function is:
>
>iReturnCode = pIggCsi00(PARM1, PARM2, PARM3);
>
>I'm stumped.
>
>----------------------------------------------------------------------
>For IBM-MAIN subscribe / signoff / archive access instructions,
>send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN