Simon Coulter wrote:
On 30/09/2009, at 4:09 PM, Dave McKenzie wrote:

One possibility is to use the QWVRCSTK API to examine the
stack. I put a sample pgm at:

Thanks. I considered that option but felt (entirely subjective
with no empirical evidence) that materialising the call stack
would be slower than getting parent pid and job name. Still, I
only need to test if in QSH once in the program so speed doesn't
really matter. I'll try to make time to time both approaches.

FWiW [although you already know this :-)]: The search for the program could be made easier by using [i.e. deferring to the logic in] the QMHSNDPM API instead, by sending a message to the [each of the] program(s) that indicates the process is running via the shell invocation; of course, using the return code invocation. Use of the send program message API eliminates the receiver variable size issue due to a potentially /deep/ stack [e.g. two calls & dynamic storage allocation], although adding the step to remove any successful request to send the message.

Regards, Chuck

This thread ...


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

This mailing list archive is Copyright 1997-2019 by 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].