[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: My program doesn't speak Portugese!
- From: Coda Highland <chighland@...>
- Date: Thu, 25 Feb 2016 15:38:52 -0800
On Thu, Feb 25, 2016 at 3:28 PM, David Given <dg@cowlark.com> wrote:
> On 23/02/16 22:33, Luke Drummond wrote:
> [...]
>> `io.open` returns `errno` as its 3rd return value
>
> That is, unfortunately, not documented. Can I rely on it?
>
> There's also a more subtle problem --- errnos aren't very standardised.
> Luckily, the low-value ones are usually the same across platforms (I
> need to support Windows *and* Linux *and* BSD *and* OSX). ENOENT seems
> to be 2 on most. I found a handy table:
>
> http://www.ioplex.com/~miallen/errcmp.html
>
> Shame there isn't a portable way of converting an errno to an identifier
> string and back...
>
> --
> ┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
> │ "There is nothing in the world so dangerous --- and I mean *nothing*
> │ --- as a children's story that happens to be true." --- Master Li Kao,
> │ _The Bridge of Birds_
>
As mentioned elsewhere in the thread, it actually IS documented, just
not very obviously, and the manual contains a slight contradiction
that probably ought to be fixed.
/s/ Adam