[PATCH] alpha: Change gethostname overflow errno from EOVERFLOW to ENAMETOOLONG
panzhe
panzhe@kylinos.cn
Thu Jun 4 09:24:10 GMT 2026
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>
---
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;
}
--
2.25.1
More information about the Libc-alpha
mailing list