On Mon, Jul 16, 2001 at 12:03:33PM -0400, Sam Steingold wrote:
> > * Honorable Peter Wood <peter.wood@...> writes:
> > Is there some compelling reason that running programs has to go
> > through the shell? "(run-program ...)" is just a frontend for
> > "(run-shell-command ... :may-exec t)", right? Is this purely for
> > portability reasons?
> it also saves you PATH handling.
> and you should not underestimate the portability concerns...
> > It's easy enough to run programs without /bin/sh using linux:fork and
> > linux:execlp*, but wait() is missing. Is there some horrible,
> > insurmountable ffi thing with wait()? How difficult would it be to do
> > a complete binding for wait() so all the WIF*(stat_val) stuff was
> > accessible from Lisp?
> > I want to use CLISP as _the_ shell, not as a frontend to /bin/sh.
> /bin/sh is so small that this should not matter
> Yes, is all you want to do is start other programs, CLISP is probably
> _not_ the right tool.
> CLISP is good for many other things though :-)
To answer my own question:
It is not a problem adding wait() and waitpid() to linux.lisp. I have
just done it. Took about 20 minutes, including the remake.
The WIF*(stat_val) stuff is inaccesible, I think, but wait() itself
works fine, so now my shell can do
(with-fork (child-process) (parent-process))
And either have parent wait for child or not, as I choose, and without
the _fscking_ shell intermediary. And with the option of easing the
syntax of run-program.