× 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 Scott,

Thank you for answer! I have changed my programm, exactly as your
example but waitpid() still returns stat_loc = *zero.
Could you help me one more time, please!!! Actually, i have never
worked with spawn() and waitpid() before.
I tested programm a lot of times in debugger and waitpid() returned
processID but stat_loc was = *zero.

I am looking forward to your letter!

Best Wishes,
Oleg.


----- Переслано: Oleg A Dmitriev/alfa-bank дата: 28.10.2008 12:22 -----

Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx>
От: rpg400-l-bounces@xxxxxxxxxxxx
27.10.2008 19:22
Срок ответа для:
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>


Кому
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>
Копия

Тема
Re: waitpid() returns *stat_loc = Null pointer






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


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.