Personally I like this approach:
From the man page: "Return Value -- On success, zero is returned. On error,
-1
is returned, anderrno
is set appropriately."
This is followed by a list of
errno
codes and their causes. Which one of these is causing your failure will be apparent when you check the value oferrno
. Theperror
andstrerror
functions can automatically map the numeric value oferrno
to a short description.
It provides the next step in debugging (check errno
), proves that what they need is in the documentation (the man page, specifically), and doesn't save them from actually having to read the documentation themselves.
The link too is helpful, but there are other ways to get a copy of the man page, so even if the link breaks the answer is still useful.