Well, since errors generally occur while doing something, your best bet is to look up the man
page for "something".
For example, if you get back an errno
of 34 from your fscanf()
call, you would first do:
grep 34 $(find /usr/include -name '*errno*h')
to figure out what the error was:
/usr/include/bits/errno.h:#define ERANGE 34 /* Math result not representable. */
/usr/include/asm-generic/errno-base.h:#define ERANGE 34 /* Math result not ... */
Then, looking at the man
page for fscanf()
, you see:
ERANGE - The result of an integer conversion would exceed the size
that can be stored in the corresponding integer type.
and you would (hopefully) be able to figure it out from there.
If you want a list of the errors and (brief) description, modify the grep
above as follows:
grep define $(find /usr/include -name '*errno*h') | less
and browse the output.
And, if you still don't know about the error and what caused it (the descriptions are a little terse, I'll agree), I would just bung it (e.g., EADDRNOTAVAIL
) into that little dialog box in the top right corner of your browser1 and you'll get back something like this (or many other wonderful pages):
Cannot assign requested address
You are attempting to bind(2)
to a local address that isn't local. For example if the IP addresses of a machine are 127.0.0.1
and 1.2.3.4
and you're trying to bind to 1.2.3.5
, you are going to get this error. Check to make sure the address you are trying to bind to exists on the machine you are trying to bind it from.
This error can also come up if you're doing a "pre-bound connect", where you're first binding to a local port, then doing an outbound connect with a socket. If the local port is already connected to the given remote IP and port (i.e., there's already an identical socketpair), you'll receive this error (value = 99 on Linux).
4 pages link to EADDRNOTAVAIL
:
- bind(2)
- connect(2)
- setsockopt(2)
- packet(7)
Go ahead, try it with other error values as well, it's not too bad.
1 You are using Firefox, right? :-)