This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 452be3375ea307b7b75f71a6e7ab361b65258664 Author: Marco Casaroli <[email protected]> AuthorDate: Fri Oct 23 14:24:59 2026 +0200 Documentation: Describe hstrerror() and herror(). Add the two resolver error functions to the network interfaces, after the DNS query functions that set h_errno. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <[email protected]> --- Documentation/reference/user/11_network.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Documentation/reference/user/11_network.rst b/Documentation/reference/user/11_network.rst index fcee9069cfc..09341c09e22 100644 --- a/Documentation/reference/user/11_network.rst +++ b/Documentation/reference/user/11_network.rst @@ -622,3 +622,26 @@ name servers, timeouts and retries as the DNS client. ``dn_comp()``, :return: The size of the name in bytes on success; -1 if the name is not valid or does not end before ``end``. + +Resolver Error Messages (``netdb.h``) +------------------------------------- + +``gethostbyname()``, ``gethostbyaddr()`` and :c:func:`res_query` give their +errors in ``h_errno``. These functions give the message for an ``h_errno`` +value. They are available with ``CONFIG_LIBC_NETDB``. + + - :c:func:`hstrerror` + - :c:func:`herror` + +.. c:function:: const char *hstrerror(int errnum); + + Give the message for ``errnum``: ``HOST_NOT_FOUND``, ``NO_DATA``, + ``NO_RECOVERY`` or ``TRY_AGAIN``. Other values give "Unknown resolver + error". + + :return: A constant string, never ``NULL``. + +.. c:function:: void herror(const char *s); + + Write the message for the current ``h_errno`` to ``stderr``. When ``s`` is + not ``NULL`` and not empty, the line starts with ``s`` and ``": "``.
