]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
manual: Document error codes missing for 'if_indextoname'
authorMaciej W. Rozycki <macro@redhat.com>
Wed, 4 Jun 2025 15:27:20 +0000 (16:27 +0100)
committerMaciej W. Rozycki <macro@redhat.com>
Wed, 4 Jun 2025 15:27:20 +0000 (16:27 +0100)
Add documentation for ENXIO error code returned and refer to 'socket'
for further possible codes from the underlying function call.

While changing the text clarify the description by mentioning 'ifname'
and replace @code tags with @var ones where referring to a function
parameter.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
manual/socket.texi

index 2f0e7509e92974d1a8b72aff064202c13ea841a3..a6fb6b1b7e2b047362f124ae7bcee0e47f025147 100644 (file)
@@ -505,11 +505,22 @@ name.  If no interface exists with the name given, it returns 0.
 @safety{@prelim{}@mtsafe{}@asunsafe{@asulock{}}@acunsafe{@aculock{} @acsfd{}}}
 @c It opens a socket with opensock to use ioctl on the fd to get the
 @c name from the index.
-This function maps an interface index to its corresponding name.  The
-returned name is placed in the buffer pointed to by @code{ifname}, which
-must be at least @code{IFNAMSIZ} bytes in length.  If the index was
-invalid, the function's return value is a null pointer, otherwise it is
-@code{ifname}.
+This function maps an interface index @var{ifindex} to its corresponding
+name.  The returned name is placed in the buffer pointed to by @var{ifname},
+which must be at least @code{IFNAMSIZ} bytes in length.
+
+The return value is @var{ifname} on success.  On failure, the function's
+return value is a null pointer and @code{errno} is set accordingly.  The
+following @code{errno} values are specific to this function:
+
+@table @code
+@item ENXIO
+There is no interface at the index requested.
+@end table
+
+Additionally, since @code{if_indextoname} invokes @code{socket}
+internally, @code{errno} may also be set to a value listed for the
+@code{socket} function (@pxref{Creating a Socket}).
 @end deftypefun
 
 @deftp {Data Type} {struct if_nameindex}