Lisp HUG Maillist Archive

Child termination for LWL

Unable to parse email body. Email id is 7227

Re: Child termination for LWL

On Thu, Nov 29, 2007 at 02:22:17PM +0000, Nick Levine wrote:
> I want to know the signal - if any - which terminates a child
> process. Is this possible, whether through open-pipe, call-system,
> run-shell-command, or any other route?

Data point (you may've already known this): the "wait" manpage says
you should be able to get the signal from the return code of the
process.  The ref guide says you should be able to get the return code
using SYS:RUN-SHELL-COMMAND ... :SAVE-EXIT-STATUS T and
SYS:PID-EXIT-STATUS (and, actually, a couple other ways).  Testing
with lwl 5.0.2, running "sleep" in various ways, and killing it in
various ways, always results in an exit status of 0.

Though if I write a shell script that says "exit 3", and don't kill
it, I get 3.

By contrast

  perl -e 'system("sleep 62"); print "$?\n";'

which is supposed to do about the same thing, works.

It looks like Lispworks does an 8-bit shift-right before it returns
the exit status.

Sounds like it's bug-report time.  :-\

-- L


Updated at: 2020-12-10 08:44 UTC