int
main(void)
{
- int i, j, e, iota = 1;
+ int i, e, iota = 1;
char buf[1024];
printf("\n// Go names for Windows errors.\n");
printf("\n// Invented values to support what package os and others expects.\n");
printf("const (\n");
for(i=0; i<nelem(errors); i++) {
- e = errors[i].value;
- strcpy(buf, strerror(e));
- // lowercase first letter: Bad -> bad, but STREAM -> STREAM.
- if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z)
- buf[0] += a - A;
printf("\t%s", errors[i].name);
if(iota) {
printf(" = APPLICATION_ERROR + iota");
printf("var errors = [...]string {\n");
for(i=0; i<nelem(errors); i++) {
e = errors[i].value;
- for(j=0; j<i; j++)
- if(errors[j].value == e) // duplicate value
- goto next;
strcpy(buf, strerror(e));
// lowercase first letter: Bad -> bad, but STREAM -> STREAM.
if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z)
ECONNREFUSED - APPLICATION_ERROR: "connection refused",
ECONNRESET - APPLICATION_ERROR: "connection reset by peer",
EDEADLK - APPLICATION_ERROR: "resource deadlock avoided",
+ EDEADLOCK - APPLICATION_ERROR: "resource deadlock avoided",
EDESTADDRREQ - APPLICATION_ERROR: "destination address required",
EDOM - APPLICATION_ERROR: "numerical argument out of domain",
EDOTDOT - APPLICATION_ERROR: "RFS specific error",
ENOTTY - APPLICATION_ERROR: "inappropriate ioctl for device",
ENOTUNIQ - APPLICATION_ERROR: "name not unique on network",
ENXIO - APPLICATION_ERROR: "no such device or address",
+ EOPNOTSUPP - APPLICATION_ERROR: "operation not supported",
EOVERFLOW - APPLICATION_ERROR: "value too large for defined data type",
EOWNERDEAD - APPLICATION_ERROR: "owner died",
EPERM - APPLICATION_ERROR: "operation not permitted",
EUCLEAN - APPLICATION_ERROR: "structure needs cleaning",
EUNATCH - APPLICATION_ERROR: "protocol driver not attached",
EUSERS - APPLICATION_ERROR: "too many users",
+ EWOULDBLOCK - APPLICATION_ERROR: "resource temporarily unavailable",
EXDEV - APPLICATION_ERROR: "invalid cross-device link",
EXFULL - APPLICATION_ERROR: "exchange full",
EWINDOWS - APPLICATION_ERROR: "not supported by windows",