Quote:
Originally Posted by ntubski
Try the clisp mailing list perhaps?
|
I actually did something a little more direct. I reported it as a bug at sourceforge, and they have
fixed it for the next release. The fix is to advise me to use
(posix:wait), and for the lisp developers to disable
(linux:waitpid), since clisp ignores the
SIGCLD signal unless the process is doing a
(posix:wait). Unfortunately, that isn't a real fix; all it does is kick the can down the road. The fix doesn't work if the parent doesn't get around to doing the
(posix:wait) until after the child has exited. So this code:
Code:
#!/usr/bin/clisp
(defun firstborn ()
(format t "firstborn is sleeping 3 seconds~%")
(sleep 3)
(format t "firstborn is done~%")
(quit 10))
(defun secondborn()
(format t "secondborn is sleeping 3 seconds~%")
(sleep 3)
(format t "secondborn is done~%")
(quit 11))
(setq fork-result (linux:fork))
(when (minusp fork-result)
(format t "first (fork) failed~%")
(quit 1))
(when (zerop fork-result)
(firstborn))
(format t "results from first wait:~{ ~a~}~%"
(multiple-value-list (posix:wait)))
(setq fork-result (linux:fork))
(when (minusp fork-result)
(format t "second (fork) failed~%")
(quit 1))
(when (zerop fork-result)
(secondborn))
(format t "parent is sleeping 5 seconds~%")
(sleep 5)
(format t "parent is done sleeping~%")
(format t "(ignore-errors) returned:~{ ~a~}~%This is unfortunate.~%"
(multiple-value-list (ignore-errors
(format t "results from second wait:~{ ~a~}~%"
(multiple-value-list (posix:wait))))))
produces this:
Code:
firstborn is sleeping 3 seconds
firstborn is done
results from first wait: 28627 EXITED 10
secondborn is sleeping 3 seconds
parent is sleeping 5 seconds
secondborn is done
parent is done sleeping
(ignore-errors) returned: NIL
UNIX error 10 (ECHILD): No child processes
This is unfortunate.
So I guess I'm going to report another bug. Sigh.