Closed weissi closed 7 years ago
In Error.swift, a lookup table errorDescriptions from errno value to error string is defined. It seems like it's a copy from Linux as there is
Error.swift
errorDescriptions
errno
11: "Resource temporarily unavailable",
which corresponds to EAGAIN I think. However, on the different Unices, the errno values aren't the same. for example on Linux
EAGAIN
$ uname -srvmp Linux 4.4.0-36-generic #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016 x86_64 x86_64 $ find /usr/include/ -name 'errno*' -exec grep EAGAIN '{}' \; #define EWOULDBLOCK EAGAIN /* Operation would block */ #define EAGAIN 11 /* Try again */
but on macOS:
$ uname -srvmp Darwin 16.1.0 Darwin Kernel Version 16.1.0: Sat Sep 17 23:18:50 PDT 2016; root:xnu-3789.20.47~8/DEVELOPMENT_X86_64 x86_64 i386 $ find /usr/include/ -name 'errno*' -exec grep EAGAIN '{}' \; /* 11 was EAGAIN */ #define EAGAIN 35 /* Resource temporarily unavailable */ #define EWOULDBLOCK EAGAIN /* Operation would block */
On macOS, 11 is EDEADLK:
11
EDEADLK
#define EDEADLK 11 /* Resource deadlock avoided */ /* 11 was EAGAIN */
The correct way of generating this table would be to use strerror(3) or maybe include a platform specific version.
strerror(3)
Fixed in version 1.2.0
Closing this if it's fixed.
In
Error.swift
, a lookup tableerrorDescriptions
fromerrno
value to error string is defined. It seems like it's a copy from Linux as there iswhich corresponds to
EAGAIN
I think. However, on the different Unices, theerrno
values aren't the same. for example on Linuxbut on macOS:
On macOS,
11
isEDEADLK
:The correct way of generating this table would be to use
strerror(3)
or maybe include a platform specific version.