errno values
Segher Boessenkool
segher@kernel.crashing.org
Thu Jan 29 14:46:00 GMT 2004
On 27-jan-04, at 19:54, Andre Kirchner wrote:
> I made a program that returns error number 13, but I
> don't know what error correspond to 13.
Here, have some. It won't print the symbolic name, but the
descriptive value instead; shouldn't be too hard to match :-)
Segher
/* perror.c */
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char **argv)
{
if (argc != 2) {
fprintf(stderr, "Usage: %s <errno>\n", argv[0]);
return 1;
}
puts(strerror(atoi(argv[1])));
return 0;
}
More information about the Gcc-help
mailing list