[plt-scheme] ffi & errno

From: Eli Barzilay (eli at barzilay.org)
Date: Fri Jul 25 03:23:14 EDT 2008

On Jul 24, YC wrote:
> Hi -
> 
> I found this thread discussing FFI & errno -
> http://list.cs.brown.edu/pipermail/plt-scheme/2008-March/023478.html.  Is
> there a potential solution on the horizon?
> 
> I currently wrap it in a procedure as follows:
> 
> (define (libc:errno)
>   (get-ffi-obj "errno" libc _int
>                (lambda ()
>                  (error 'libc:errno
>                         "unable to retrieve errno"))))
> 
> Is this even close?  I imagine that it's possible for mzscheme to set errno
> before I retrieve the value...

That's exactly the problem.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


Posted on the users mailing list.