[PATCH] alpha: Change gethostname overflow errno from EOVERFLOW to ENAMETOOLONG
Adhemerval Zanella Netto
adhemerval.zanella@linaro.org
Thu Jun 4 12:14:08 GMT 2026
On 04/06/26 06:24, panzhe wrote:
> Align alpha gethostname implementation with man-pages
> spec, return ENAMETOOLONG instead of EOVERFLOW when
> buffer is too small.
>
> References:
> https://man7.org/linux/man-pages/man2/gethostname.2.html
>
> Signed-off-by: panzhe <panzhe@kylinos.cn>
I would just remove the alpha implementation and the generic posix one
that issues uname.
> ---
> sysdeps/unix/sysv/linux/alpha/gethostname.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sysdeps/unix/sysv/linux/alpha/gethostname.c b/sysdeps/unix/sysv/linux/alpha/gethostname.c
> index d2bd213c24..b7ac91bb30 100644
> --- a/sysdeps/unix/sysv/linux/alpha/gethostname.c
> +++ b/sysdeps/unix/sysv/linux/alpha/gethostname.c
> @@ -34,7 +34,7 @@ __gethostname (char *name, size_t len)
> an error. */
> && memchr (name, '\0', len) == NULL)
> {
> - __set_errno (EOVERFLOW);
> + __set_errno (ENAMETOOLONG);
> result = -1;
> }
>
More information about the Libc-alpha
mailing list