× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On Fri, 22 Oct 2004, Lim Hock-Chai wrote:

> okay.  Now I'm a bit confuse.  I understand when you said stat() is a
> unix api not a c run time function, but I don't understand the part
> about it is not in one of the service program in QC2LE binding
> directory.

When a program is compiled, not every bit of the code is generated.
Instead, the compiler generates routines that call routines in service
programs -- these services programs are known as the "ILE RPG Runtime" (or
"ILE C Runtime" or "ILE CL Runtime" or whatever language you're compiling)

So, each ILE language will automagically bind to binding directories that
you don't specify.

QC2LE is one of the binding directories that is automatically specified
for you if you code an ILE C program.  It's necessary to explicitly
specify it in an RPG program because RPG doesn't by default use the ILE C
runtime.

Likewise there's a binding directory for RPG -- I think it's QRNXLE, but
not 100% sure...   if an ILE C program really wanted to, it could use some
of RPG's functions by binding to that binding directory.

System APIs, like stat(), are automatically included in all languages
binding directories.  Stat() will work just fine if you omit
BNDDIR('QC2LE') from your RPG program.


> If stat() is not in QC2LE, how can the binder find it when creating
> program that uses this api.  I use your socket program example to create
> scoket program before and I know those socket functions are unix api and
> I also know that it require Bnddir('QC2LE') on the H spec to get the RPG
> program to compile.


Wrong. The socket functions do NOT require QC2LE on the H-spec.  The only
thing in my sockets tutorial that requires the QC2LE binding directory are
the __errno() and strerror() functions.

Everything else (socket(), listen(), connect(), bind(), recv(), send(),
close(), etc) are automatically bound to by any ILE language if needed.

The same is true of all of the IFS APIs...  open(), read(), write(),
close(), stat(), etc.  The only need for QC2LE is to get __errno() or
strerror().

However, the ILE C runtime does have some IFS functions of it's own.
fopen(), fgets(), fputs(), fclose()... that whole class of functions is
part of the ILE C runtime and are not system APIs!  So, for those, you
need QC2LE, and the documentation is in the ILE C/C++ Runtime Library
reference manual.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.