[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

From: address@hidden
Subject: bug#18592: FFI should have portable access to ‘errno’
Date: Sun, 25 Jan 2015 21:59:32 +0100

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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]