From mint-bounce@lists.fishpool.fi Fri Oct 28 23:20:12 2005 X-Original-To: fnaumann@mail.boerde.de Delivered-To: fnaumann@mail.boerde.de Subject: [MiNT] pexit, pwaitpid and return values From: Odd Skancke To: MiNT List Content-Type: text/plain Date: Fri, 28 Oct 2005 23:15:03 +0000 Message-Id: <1130541303.5390.19.camel@linuxbox> Mime-Version: 1.0 X-Mailer: Evolution 2.0.4 (2.0.4-6) Content-Transfer-Encoding: 7bit X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-To: mint-bounce@lists.fishpool.fi X-original-sender: ozk@atari.org Precedence: bulk List-help: List-unsubscribe: List-Id: X-List-ID: X-Virus-Scanned: by amavisd-new at relay.boerde.de X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on relay.boerde.de X-Spam-Status: No, hits=2.1 tagged_above=-50.5 required=7.0 tests=BAYES_00, RCVD_IN_SORBS X-Spam-Level: ** 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