This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: errno values
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Andre Kirchner <supercroc1974 at yahoo dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 29 Jan 2004 15:46:51 +0100
- Subject: Re: errno values
- References: <20040127185427.31711.qmail@web13011.mail.yahoo.com>
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;
}