Hello Witold,
> The man page doesn't tell how the error code is returned back to the
> caller.
>
> Looking at the source code of hsearch and hsearch_r it looks to be via
> errno, but manpage doesn't mention this at all.
I'm a bit lost here. The manual page says:
In the event of an error, these two functions set errno to
indicate the cause of the error.
This seems clear to me, or, otherwise, I really am missing your
point, I'm sorry.
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/