Discussion:
[Larceny-users] Re
Marco Maggi
2009-01-02 09:12:38 UTC
Permalink
"No function in this volume of IEEE Std
1003.1-2001 shall set errno to 0."
Just to keep that in mind....
Right. So, quoting more from that same link,
An application that needs to examine the
value of errno to determine the error should
set it to 0 before a function call, then
inspect it before a subsequent function call.
The question becomes, if someone writes a scheme
layer wrapping the libc layer, then do they
violate POSIX semantics in the context of the
scheme layer if their wrapper sets errno to zero
before calling the glibc function associated with
it?
I dunno if there is value in letting the POSIX
semantics filter through a Scheme layer, what
I know is that there are functions, like
"readdir()", for which setting "errno" to zero
before the call is the only way to distinguish
an error condition from another event.

So setting "errno" is a mandatory feature.
--
Marco Maggi

"Now feel the funk blast!"
Rage Against the Machine - "Calm like a bomb"
William D Clinger
2009-01-02 14:31:08 UTC
Permalink
Post by Marco Maggi
So setting "errno" is a mandatory feature.
As of revision 5884, get-errno and set-errno! are
present in Larceny's R5RS mode and can be imported
into ERR5RS and R6RS modes using the "primitives"
extension.

Will

Loading...