1 # Derived from libc errlist.awk
4 printf("/* This file is automatically generated by error.awk */\n\n");
5 printf("#include \"inc.h\"\n\n");
6 printf("static const char *const errors[] = {\n");
13 if (number ==
"(_SIGN")
15 if (number
< 0 || number ==
"EAGAIN")
17 printf("\t[%s] = \"%s\",\n", name
, name
);
21 printf("const char *\nget_error_name(int err)\n{\n\n");
22 printf("\tif (err >= 0 && (unsigned int)err < __arraycount(errors) &&\n");
23 printf("\t errors[err] != NULL)\n");
24 printf("\t\treturn errors[err];\n");
26 printf("\t\treturn NULL;\n");