[PATCH 1/5] manual: Document error codes missing for 'socket'

Florian Weimer fweimer@redhat.com
Mon May 26 13:25:17 GMT 2025


* Maciej W. Rozycki:

> From: Maciej W. Rozycki <macro@redhat.com>
>
> Add missing EAFNOSUPPORT, ESOCKTNOSUPPORT, EPROTOTYPE, EINVAL, EPERM, 
> and ENOMEM error codes, and adjust existing descriptions accordingly.
>
> On Linux either ENOBUFS or ENOMEM is returned in the case of a memory 
> allocation failure, depending on the namespace requested, e.g. AF_INET 
> returns ENOMEM while AF_INET6 returns ENOBUFS, so document these codes 
> as alternatives.
>
> Similarly EPERM is returned rather than EACCES on Linux, so document 
> these codes as alternatives as well.  We might want to convert EPERM to 
> EACCES for POSIX compliance, but it is beyond the scope of this change, 
> and software has to expect either anyway, owing to the long-established 
> practice.
>
> Finally ESOCKTNOSUPPORT is returned rather than EPROTONOSUPPORT for an
> unsupported style except for the AF_QIPCRTR namespace where EPROTOTYPE 
> is used, so document these codes as alternatives too.

>  manual/socket.texi |   18 +++++++++++++++---
>  1 file changed, 15 insertions(+), 3 deletions(-)

Thanks, this looks good.

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

Florian



More information about the Libc-alpha mailing list