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: Zbigniew
Subject: Re: [Chicken-users] Return value of `system'
Date: Wed, 14 Mar 2007 20:33:34 -0500

On 3/14/07, Kon Lovett <address@hidden> wrote:
Zbigniew wrote:
> Exit values should be distinguishable from signals (and even from
> signals+core dumps).

   return C_fix(WIFEXITED(n) ? WEXITSTATUS(n) : (WIFSIGNALED(n) ?
WTERMSIG(n) : WSTOPSIG(n)));

I don't always talk thru my hat ;-)

Don't worry, I would expect nothing less from you.  I figured you had
already checked the code and the return value might be munged.

In my experience, on a UNIX box it is imperative that you get the full
range of information provided by system(), especially since Chicken's
intent is to be as practical as possible.  My opinion is that (system)
should return system()'s raw return value-- i.e. C_fix(n) --and that
accessor functions be provided to tease that information apart, along
the lines of the C macros.  Since (system) is in unit library and much
is deliberately left to the vagaries of the system, it may be more
acceptable to create a new function and accessors in Unit posix. (Or
in a separate egg so people don't need cutting-edge Chicken?)




reply via email to

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