chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Return value of `system'


From: felix winkelmann
Subject: Re: [Chicken-users] Return value of `system'
Date: Thu, 15 Mar 2007 07:25:30 +0100

On 3/15/07, Zbigniew <address@hidden> wrote:

To answer Mario's question, the result returned from system() is
either the exit status or the signal number on any modern UNIX
machine; this is the same  as described in process-wait.  It also
returns 127 upon shell execution failure (I tested this) and 'errno'
upon waitpid or fork failure [again, cannot distinguish this from
signal or non-zero exit code].

This is well-defined and useful information, so I think that the
current return value behavior for UNIX should at least be documented.


I have changed `system' to raise an exception if the call returns a negative
value (i.e. fork failed) or it returns the process return value unchanged.
Any further processing of the status can be done via FFI functions.
For more functionality, stuff from the posix unit or osprocess egg can
be used.


cheers,
felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]