IIRC this technique was fairly common in the old COBOL days. IIRC you could 
call an assembler routine passing the name of an FD and the program got passed 
the address of the DCB. I think has not worked in some time -- well, in some 
number of COBOL versions.

Charles


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Bernd Oppolzer
Sent: Wednesday, July 14, 2021 1:55 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Mixing C/C++ with LE-conforming IBM HLASM

IMHO this is not a good idea, because the C/C++ runtime probably
did more things than simply construct a DCB and open it; IMO it 
allocated storage for buffers etc., too.
And if you "steal" the open DCB from it, you will leave the C/C++ 
runtime in an undefined state,
at best, even if you plan not to use the C/C++ file functions after the 
fopen() call;
you will have a storage leak IMO.

And: no, I have no idea how to get the DCB from the C/C++ FILE structure.

(I am a compiler maintainer myself, and I cannot imagine someone 
successfully
using the DCBs, which are part of my Pascal File control structures, and 
doing I/O using them,
this way "fooling" the Pascal runtime system ... but, who knows).

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to