Rich Felker wrote:
> > +@item
> > +The returned @code{struct servent} has a nonsensical @code{s_aliases} value
> > +on some platforms:
> > +musl libc.
>
> Can you clarify "nonsensical"?
Sure: When I ask for the services with name == "www", I get
{ s_name = "www", s_aliases = [ "www" ], port = 80 }.
1) The s_aliases array is described in POSIX [1] as "alternative"
service names. If the only information you got is "www", I would
expect a return value without duplicates, namely
{ s_name = "www", s_aliases = [], port = 80 }.
2) When I ask for the services with name == "http", I get
{ s_name = "http", s_aliases = [ "http" ], port = 80 }.
So, evidently, "http" and "www" are aliases of each other. What I would
have expected — and what all other libcs return — is either
{ s_name = "www", s_aliases = [ "http" ], port = 80 }
or
{ s_name = "http", s_aliases = [ "www" ], port = 80 }
Bruno
[1] https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/netdb.h.html