This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: errno values


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;
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]