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



Hello Oleg,

I use waitpid(PID:stat_loc:0) function to chek status but it always return stat_loc = *zero but PID = ProcessID.

Your prototype for waitpid() is wrong. It should look like this:

D waitpid PR 10i 0 extproc('waitpid')
D pid 10i 0 value
D stat_loc 10I 0
D options 10I 0 value

The second parameter is an integer passed by reference. In C, it'll be shown as "int *stat_loc" because, in C, you pass a pointer to a field in order to pass it by reference. RPG passes by reference by default -- so you simply declare the integer parm with no special keywords in RPG.

You could potentially make a pointer work as well -- but not the way you coded it -- and I suspect that's why it was not working for you.

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.