]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
alpha: Use the generic gethostname master
authorMagnus Lindholm <linmag7@gmail.com>
Sun, 9 Aug 2026 22:08:02 +0000 (00:08 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Mon, 10 Aug 2026 09:26:21 +0000 (11:26 +0200)
alpha was the only target implementing gethostname with the syscall
rather than through uname. Its only behavioural difference was the errno
for a too-small buffer: it reported EOVERFLOW where the generic
implementation, gethostname(2) and misc/tst-gethostname expect
ENAMETOOLONG, so alpha failed that test:

  tst-gethostname.c:96: numeric comparison failure
     left: 112 (0x70, EOVERFLOW); from: errno
    right: 63 (0x3f); from: ENAMETOOLONG

The file contains nothing but that function, so removing it lets the
sysdeps search fall through to sysdeps/posix/gethostname.c, which
produces the same buffer contents and the expected errno.
misc/tst-gethostname passes on alpha with it.

Suggested-by: Florian Weimer <fw@deneb.enyo.de>
Signed-off-by: Magnus Lindholm <linmag7@gmail.com>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
sysdeps/unix/sysv/linux/alpha/gethostname.c [deleted file]

diff --git a/sysdeps/unix/sysv/linux/alpha/gethostname.c b/sysdeps/unix/sysv/linux/alpha/gethostname.c
deleted file mode 100644 (file)
index d2bd213..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Copyright (C) 2001-2026 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library.  If not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-int
-__gethostname (char *name, size_t len)
-{
-  int result;
-
-  result = INLINE_SYSCALL (gethostname, 2, name, len);
-
-  if (result == 0
-      /* See whether the string is terminated.  If not we will return
-        an error.  */
-      && memchr (name, '\0', len) == NULL)
-    {
-      __set_errno (EOVERFLOW);
-      result = -1;
-    }
-
-  return result;
-}
-
-weak_alias (__gethostname, gethostname)