[PATCH 3/5] manual: Document error codes missing for 'if_nametoindex'

Florian Weimer fweimer@redhat.com
Tue May 27 15:01:34 GMT 2025


* Maciej W. Rozycki:

> On Mon, 26 May 2025, Florian Weimer wrote:
>
>> > Index: glibc/manual/socket.texi
>> > ===================================================================
>> > --- glibc.orig/manual/socket.texi
>> > +++ glibc/manual/socket.texi
>> 
>> > +@item ENOSYS
>> > +This function is not implemented.
>> > +@end table
>> 
>> Likewise, I don't think we should document ENOSYS.
>
>  Again, for Hurd we have this:
>
>   if (__ioctl (fd, SIOCGIFINDEX, &ifr) < 0)
>     {
>       int saved_errno = errno;
>       __close (fd);
>       if (saved_errno == EINVAL || saved_errno == ENOTTY)
>         __hurd_fail (ENOSYS);
>
> and for Linux even:
>
> #ifndef SIOCGIFINDEX
>   __set_errno (ENOSYS);
>   return 0;
> #else
>
> I guess for Linux we just ought to discard the obsolete conditional, as 
> the definition of SIOCGIFINDEX goes back as far as Linux 2.1.72 (when a 
> correction has been applied to rename SIOGIFINDEX and the feature itself 
> is yet older) and we surely rely on the kernel being used to be more 
> modern that that.

Correct, the #ifdef is unnecessary.  Our build uses our own headers with
its definition anyway.

>  So it boils down to the Hurd piece really and if we agree that it's an 
> implementation bug instead that we want to address, then I'm fine with 
> dropping ENOSYS from the documentation update proposed.

It's not a bug, but I see what you mean. 8-)

Thanks,
Florian



More information about the Libc-alpha mailing list