[PATCH v2 3/3] manual: Document error codes missing for 'inet_pton'

Florian Weimer fweimer@redhat.com
Mon Jun 2 12:19:09 GMT 2025


* Maciej W. Rozycki:

> From: Maciej W. Rozycki <macro@redhat.com>
>
> Add documentation for EAFNOSUPPORT error code returned, and the possible 
> return values on non-success.
> ---
> Changes from v1 (5/5):
>
> - Clarify the interpretation of the return value.
> ---
>  manual/socket.texi |   11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> glibc-doc-inet_pton-err.diff
>
> Index: glibc/manual/socket.texi
> ===================================================================
> --- glibc.orig/manual/socket.texi
> +++ glibc/manual/socket.texi
> @@ -1216,6 +1216,17 @@ either @code{AF_INET} or @code{AF_INET6}
>  address being converted.  @var{cp} is a pointer to the input string, and
>  @var{buf} is a pointer to a buffer for the result.  It is the caller's
>  responsibility to make sure the buffer is large enough.
> +
> +The return value is @code{1} on success and @code{0} if @var{cp} does not
> +point to a valid address string for the address family @var{af} requested.
> +On failure, the function's return value is @code{-1} and @code{errno} is
> +set accordingly.  The following @code{errno} values are specific to this
> +function:
> +
> +@table @code
> +@item EAFNOSUPPORT
> +The address family requested is neither @code{AF_INET} nor @code{AF_INET6}.
> +@end table
>  @end deftypefun
>  
>  @deftypefun {const char *} inet_ntop (int @var{af}, const void *@var{cp}, char *@var{buf}, socklen_t @var{len})

This looks good now.

Reviewed-by: Florian Weimer <fweimer@redhat.com>

Thanks,
Florian



More information about the Libc-alpha mailing list