Subject: bug#18592: FFI should have portable access to ‘errno’

From: Mark H Weaver <[email-masked]>
Date: Tue, 11 Nov 2014 10:03:23 -0500

Frank Terbeck <[email-masked]> writes:

> When accessing POSIX functions from a system's libc via Guile's dynamic
> FFI, you commonly want to access the ‘errno’ variable to be able to
> produce useful diagnostic messages.
>
> Currently there's no such access built-in.
>
> Mark Weaver on IRC thought it would be a good idea to add portable
> access to the contents of ‘errno’ (however it's actually implemented) to
> Guile's FFI. And now the idea has entered the bug tracker. :)

Indeed, thanks for filing this ticket.

I see a problem with this idea: something (e.g. a system async) might
change 'errno' before the Scheme code fetches the 'errno' value.

     Mark