While QC2LE is, strictly speaking, not necessary in order to call Unix-type APIs quite a few of the Unix-type APIs do return errno values for additional information on error conditions. As errno (or more properly __errno) is exported by the C runtime library, QC2LE is often needed in writing an application taking advantage of the Unix-type APIs.
I wouldn't be too surprised though if this consideration was removed in a future release :)
Bruce Vining
Bruce Vining Services
Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx> wrote:
For the 800,000th time, you don't need QC2LE to call Unix-type APIs!
QC2LE is to call routines in the ILE C Runtime library. Unix-type APIs
are like any other APIs on the system. They're in the QUSAPIBD binding
directory like all other APIs, and that binding directory is
AUTOMATICALLY included and doesn't need to be bound to explicitly.
Again, QC2LE is for the ILE C Runtime Library -- which are also "C
APIs", but isn't required for the Unix-type APIs.
Not sure which document about calling APIs you're referring to. I don't
know of one that's about Unix-type APIs specifically. I've written many
articles about Sockets, Secure Sockets, IFS, spawn, pipes and signals,
all of them are Unix-type APIs... but they're spread across many
articles, depending on the topic. And there are many unix-type APIs I
haven't covered. If you could be more specific about which APIs you're
interested in, I might be able to point you to an article.
You might also be interested in Barbara Morris' document that explains
how C prototypes and data types can be converted to RPG's prototypes and
data types.
http://www.opensource400.org/callc.html
James Lampert wrote:
At least a year and a half ago, somebody referred me to a document
explaining how to call various C-callable routines (particularly the
"unix-type" APIs) from ILE RPG. And I know it involved the QC2LE binding
directory.
But now I've lost track of the document, and somebody else here needs it.
Can somebody point me in the right direction?
As an Amazon Associate we earn from qualifying purchases.