From: Maciej W. Rozycki Date: Wed, 4 Jun 2025 15:27:20 +0000 (+0100) Subject: manual: Document error codes missing for 'if_nametoindex' X-Git-Tag: glibc-2.42~167 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5a9020eeb27eee88e7839ff5e9cea94892ec90ff;p=thirdparty%2Fglibc.git manual: Document error codes missing for 'if_nametoindex' Add documentation for ENODEV 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'. Reviewed-by: Florian Weimer --- diff --git a/manual/socket.texi b/manual/socket.texi index a6fb6b1b7e..e8285b9200 100644 --- a/manual/socket.texi +++ b/manual/socket.texi @@ -497,7 +497,20 @@ interface name, including its terminating zero byte. @c takes a lock, which makes all callers AS- and AC-Unsafe. @c opensock @asulock @aculock @acsfd This function yields the interface index corresponding to a particular -name. If no interface exists with the name given, it returns 0. +name specified with @var{ifname}. + +The return value is the interface index on success. On failure, the +function's return value is zero and @code{errno} is set accordingly. +The following @code{errno} values are specific to this function: + +@table @code +@item ENODEV +There is no interface by the name requested. +@end table + +Additionally, since @code{if_nametoindex} 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 @deftypefun {char *} if_indextoname (unsigned int @var{ifindex}, char *@var{ifname})