× 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.



BTW, if you are in a batch job, you start with FD = 0.

If interactive, you COULD start with FD=3, since 0, 1, and 2 are preset for stdin, stdout, and stderr.

But there's probably no gain to checking job type - simpler just to start with 0.

Vern

On 6/6/2013 7:24 AM, Vernon Hamberg wrote:
Hi Mike

Did a little looking and wonder if the fcntl() function will do the
trick. You'd need to do a loop until it returns an error - that'd be the
first available descriptor.

You could use a read function in fcntl() - something like
fcntl(descriptor : 1) in RPG - both are integers passed by value. If you
get a -1 returned, that's an error.

This is just a guess - hope there's a better answer, maybe in an MI
function.

HTH
Vern

On 6/5/2013 9:59 PM, Mike Krebs wrote:
Gurus!
I have been looking around for how to find a list of open descriptors in a job without much luck. Probably my ignorance of how to search for the command or API. In particular, these are the descriptors to write to IFS files but my understanding is that descriptors can be for any "open" operation such as a socket as well.
What is the command or API that will show the list of open descriptors or the number of open descriptors in a job?


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.