[cffi-devel] CFFI and wait (2)

Lorenzo Villani lvillani at binaryhelix.net
Tue Jun 1 15:25:13 UTC 2010


On Tue, 1 Jun 2010 15:55:32 +0100
Martin Simmons <martin at lispworks.com> wrote:
> 
> Check the value returned by c-wait, because it sounds like it is getting an
> error.  If it returns -1, then you need to check errno.
> 
> You should also use unwind-protect to ensure that foreign-free is called (or
> use with-foreign-pointer instead of foreign-alloc and foreign-free).

When I tried, CLISP crashed.

> 
> I don't know about CLISP, but your code will not work reliably if the Lisp
> implementation calls wait itself (e.g. in response to SIGCHLD).  If possible,
> I would use a implementation-supplied function instead of trying to implement
> execute-program yourself.
> 

I hoped to be able to get a common implementation of that function but
given the time I am wasting and the amount of low-level and
implementation-dependant stuff I will follow your advice. Luckily both
CFFI and SBCL come with similar functions.

> __Martin
> 
-- 
Lorenzo Villani <lvillani at binaryhelix.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cffi-devel/attachments/20100601/a5e1d422/attachment.sig>


More information about the cffi-devel mailing list