- To: slug-chat@xxxxxxxxxxx
- Subject: Re: [chat] you are in a maze of twisty little header files, all alike...
- From: Benno <benjl@xxxxxxxxxxxxxxx>
- Date: Wed, 2 Jul 2003 15:18:14 +1000
- Reply-by: Mon, 2 Jun 2003 15:11:49 +1000
- User-agent: Mutt/1.5.4i
On Wed Jul 02, 2003 at 15:09:31 +1000, Jan Schmidt wrote:
><quote who="Jamie Wilkinson">
>
>> So I got a useful error message from curl just now:
>>
>> curl: (7) socket error: 113
>
>*snip*
>
>> 113 means "host unreachable". I think I might patch curl to add strerror
>> calls in the right places :-)
>>
>
>As a time saver:
>
>jan@oven:/usr/include$ grep -r 113 . | grep errno
>./asm/errno.h:#define EHOSTUNREACH 113 /* No route to host */
>
>strerror sounds like a good patch to me.
Or:
$ cat > perror.c
#include <stdio.h>
#include <errno.h>
int
main(int argc, char **argv) {
if (argc > 1) {
errno = atoi(argv[1]);
perror("Error is");
} else {
printf("Usage: perror errno\n");
}
return 0;
}
^D
$ gcc perror.c
$ ./a.out 133
Error is: No route to host
$
Benno