GNU bug report logs - #18592
FFI should have portable access to ‘errno’

Previous Next

Package: guile;

Reported by: Frank Terbeck <ft <at> bewatermyfriend.org>

Date: Tue, 30 Sep 2014 20:21:01 UTC

Severity: wishlist

Done: Mark H Weaver <mhw <at> netris.org>

Bug is archived. No further changes may be made.

Full log


Message #34 received at 18592 <at> debbugs.gnu.org (full text, mbox):

From: "guile <at> discard.email" <guile <at> discard.email>
To: 18592 <at> debbugs.gnu.org
Subject: Re: FFI should have portable access to ‘errno’
Date: Sun, 25 Jan 2015 21:59:32 +0100
[Message part 1 (text/plain, inline)]
I'd like to point out that when calling a function that might set errno in C,
it's usually good practice to set errno to zero immediately before the call,
so as to be sure that any subsequent non-zero errno value was actually
a consequence of the function call:
 
errno = 0; /* clear errno before the function call */
rtnval = my_func(...);
if (errno != 0) {...}
 
This should probably be taken into account if you're extending
the FFI to provide access to errno.
[Message part 2 (text/html, inline)]

This bug report was last modified 8 years and 338 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.