[plt-scheme] ffi question and accessing errno

From: Jakub Piotr Cłapa (jpc-ml at zenburn.net)
Date: Fri Mar 7 04:21:42 EST 2008

Eli Barzilay wrote:
> On Mar  5, Marco Maggi wrote:
>> Ciao,
>>
>> I am experimenting with the FFI with PLT 372 on GNU+Linux; is it
>> possible to access "errno"?
> 
> Not really.  You can, like any other C variable, but the problem is
> that you want the value grabbed right after the foreign call -- if you
> do it later, then the value is likely to have changed so that it
> doesn't help.  I'll need to extend the C part of the foreign interface
> to make it available somehow (I still didn't figure out what's the
> best way to address this problem).

Maybe store errno in a Scheme parameter after each FFI call?

-- 
regards,
Jakub Piotr Cłapa


Posted on the users mailing list.