alpha: Change gethostname overflow errno from EOVERFLOW to ENAMETOOLONG
Checks
| Context |
Check |
Description |
| redhat-pt-bot/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
| redhat-pt-bot/TryBot-32bit |
success
|
Build for i686
|
| linaro-tcwg-bot/tcwg_glibc_build--master-arm |
success
|
Build passed
|
| linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 |
success
|
Build passed
|
| linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 |
success
|
Test passed
|
| linaro-tcwg-bot/tcwg_glibc_check--master-arm |
success
|
Test passed
|
Commit Message
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(-)
Comments
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;
> }
>
@@ -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;
}