[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] pexit, pwaitpid and return values



Hi list,

 I think we have a conflict between pexec(), pexit() and pwait().
According to documentation I have seen on pexec() and pexit() a
processes return value is 16 bits. But due to inkernel use of pwaitpid
(), only 8 bits of this return value was returned via pexec(0). This
problem I have attempted to fix, so hopefully this is OK. Now for the
problem I think I see with pwait() and friends;

 According to Compendium, Pwait() returns a long where the high word
contains the pid and the low word contains the 16 bit exit code WHEN THE
PROCESS EXITS VIA PEXIT(), PTERMRES() OR PTERM0(). If the process was
killed or is stopped, info about which signal was used is returned in
the upper byte of the 16 bit return code. Seeing as MiNT's pwait()
implementation never returns the full 16 bit of a processes exit code
when it exits cleanly via one of these calls, we have a problem. There
is no problem having pwait() return the correct data based on how a
process terminated. The problem is, how to define a return code in which
the caller can determine for sure what information is in the code,
signal info or just plain return value from process! I think this looks
impossible with todays binding of pwait().

 Anyone with ideas on this matter? Perhaps a new extended pwait()
function is needed? As it is now, it is impossible for processes to
communicate more than a 8 bit signed number except when Pexec modes
where parent waits for child to finish is used. This is unacceptible. Or
is there something I have missed?


 Best Regards,
Odd Skancke