From 48f37b4a46840638ceee297f19041b93a152c54f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20S=C3=B6ntgen?= Date: Fri, 21 Feb 2025 14:23:48 +0100 Subject: [PATCH] libc: use original 'gai_strerror()' implementation This commit removes the dummy 'gai_strerror()' implementation in favor of the one provided in the contrib sources to allow for better diagnosing of DNS related problems. As long as NLS is not set the implementation looks up the error string via the error-code directly. Fixes #5464. --- repos/libports/lib/mk/libc-net.mk | 1 + repos/libports/lib/mk/libc.mk | 2 +- repos/libports/src/lib/libc/gai_strerror.cc | 21 --------------------- 3 files changed, 2 insertions(+), 22 deletions(-) delete mode 100644 repos/libports/src/lib/libc/gai_strerror.cc diff --git a/repos/libports/lib/mk/libc-net.mk b/repos/libports/lib/mk/libc-net.mk index a3b7ed666f..2fb6b68fca 100644 --- a/repos/libports/lib/mk/libc-net.mk +++ b/repos/libports/lib/mk/libc-net.mk @@ -5,6 +5,7 @@ SRC_C = getservent.c nsdispatch.c nsparser.c nslexer.c # needed for getaddrinfo() SRC_C += getaddrinfo.c +SRC_C += gai_strerror.c # needed for getnameinfo() SRC_C += getnameinfo.c name6.c diff --git a/repos/libports/lib/mk/libc.mk b/repos/libports/lib/mk/libc.mk index e7a4d1e942..b413892523 100644 --- a/repos/libports/lib/mk/libc.mk +++ b/repos/libports/lib/mk/libc.mk @@ -12,7 +12,7 @@ LIBS += base vfs # Back end # SRC_CC = atexit.cc dummies.cc rlimit.cc sysctl.cc \ - issetugid.cc errno.cc gai_strerror.cc time.cc alarm.cc \ + issetugid.cc errno.cc time.cc alarm.cc \ malloc.cc progname.cc fd_alloc.cc file_operations.cc \ plugin.cc plugin_registry.cc select.cc exit.cc environ.cc sleep.cc \ pread_pwrite.cc readv_writev.cc poll.cc \ diff --git a/repos/libports/src/lib/libc/gai_strerror.cc b/repos/libports/src/lib/libc/gai_strerror.cc deleted file mode 100644 index 0602364e4f..0000000000 --- a/repos/libports/src/lib/libc/gai_strerror.cc +++ /dev/null @@ -1,21 +0,0 @@ -/* - * \brief C-library back end - * \author Christian Prochaska - * \date 2010-05-16 - */ - -/* - * Copyright (C) 2010-2017 Genode Labs GmbH - * - * This file is part of the Genode OS framework, which is distributed - * under the terms of the GNU Affero General Public License version 3. - */ - -#include - -extern "C" const char *gai_strerror(int errcode) -{ - static const char *result = "gai_strerror called, not yet implemented!"; - Genode::log(__func__, ": ", result); - return result; -}