diff --git a/nscd/Makefile b/nscd/Makefile
index 2578b00e27..58a2d01e00 100644
--- a/nscd/Makefile
+++ b/nscd/Makefile
@@ -46,14 +46,8 @@ nscd-modules := \
   cachedumper \
   connections \
   dbg_log \
-  getgrgid_r \
-  getgrnam_r \
   gethstbyad_r \
   gethstbynm3_r \
-  getpwnam_r \
-  getpwuid_r \
-  getsrvbynm_r \
-  getsrvbypt_r \
   grpcache \
   hstcache \
   initgrcache \
diff --git a/nscd/getgrgid_r.c b/nscd/getgrgid_r.c
deleted file mode 100644
index 3fa0717d88..0000000000
--- a/nscd/getgrgid_r.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright (C) 1996-2026 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published
-   by the Free Software Foundation; version 2 of the License, or
-   (at your option) any later version.
-
-   This program 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 General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
-
-#include <grp.h>
-
-#include <grp-merge.h>
-
-#define LOOKUP_TYPE	struct group
-#define FUNCTION_NAME	getgrgid
-#define DATABASE_NAME	group
-#define ADD_PARAMS	gid_t gid
-#define ADD_VARIABLES	gid
-#define BUFLEN		NSS_BUFLEN_GROUP
-
-#define DEEPCOPY_FN	__copy_grp
-#define MERGE_FN	__merge_grp
-
-/* We are nscd, so we don't want to be talking to ourselves.  */
-#undef	USE_NSCD
-
-#include <nss/getXXbyYY_r.c>
diff --git a/nscd/getgrnam_r.c b/nscd/getgrnam_r.c
deleted file mode 100644
index 7be4374408..0000000000
--- a/nscd/getgrnam_r.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (C) 1996-2026 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published
-   by the Free Software Foundation; version 2 of the License, or
-   (at your option) any later version.
-
-   This program 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 General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
-
-#include <grp.h>
-
-#include <grp-merge.h>
-
-#define LOOKUP_TYPE	struct group
-#define FUNCTION_NAME	getgrnam
-#define DATABASE_NAME	group
-#define ADD_PARAMS	const char *name
-#define ADD_VARIABLES	name
-
-#define DEEPCOPY_FN	__copy_grp
-#define MERGE_FN	__merge_grp
-
-/* We are nscd, so we don't want to be talking to ourselves.  */
-#undef	USE_NSCD
-
-#include <nss/getXXbyYY_r.c>
diff --git a/nscd/getpwnam_r.c b/nscd/getpwnam_r.c
deleted file mode 100644
index e63b7fb0c1..0000000000
--- a/nscd/getpwnam_r.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright (C) 1996-2026 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published
-   by the Free Software Foundation; version 2 of the License, or
-   (at your option) any later version.
-
-   This program 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 General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
-
-#include <pwd.h>
-
-
-#define LOOKUP_TYPE	struct passwd
-#define FUNCTION_NAME	getpwnam
-#define DATABASE_NAME	passwd
-#define ADD_PARAMS	const char *name
-#define ADD_VARIABLES	name
-#define BUFLEN		NSS_BUFLEN_PASSWD
-
-/* We are nscd, so we don't want to be talking to ourselves.  */
-#undef	USE_NSCD
-
-#include <nss/getXXbyYY_r.c>
diff --git a/nscd/getpwuid_r.c b/nscd/getpwuid_r.c
deleted file mode 100644
index 3ea5f806f8..0000000000
--- a/nscd/getpwuid_r.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright (C) 1996-2026 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published
-   by the Free Software Foundation; version 2 of the License, or
-   (at your option) any later version.
-
-   This program 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 General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
-
-#include <pwd.h>
-
-
-#define LOOKUP_TYPE	struct passwd
-#define FUNCTION_NAME	getpwuid
-#define DATABASE_NAME	passwd
-#define ADD_PARAMS	uid_t uid
-#define ADD_VARIABLES	uid
-#define BUFLEN		NSS_BUFLEN_PASSWD
-
-/* We are nscd, so we don't want to be talking to ourselves.  */
-#undef	USE_NSCD
-
-#include <nss/getXXbyYY_r.c>
diff --git a/nscd/getsrvbynm_r.c b/nscd/getsrvbynm_r.c
deleted file mode 100644
index 4ac934815c..0000000000
--- a/nscd/getsrvbynm_r.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Copyright (C) 1996-2026 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published
-   by the Free Software Foundation; version 2 of the License, or
-   (at your option) any later version.
-
-   This program 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 General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
-
-#include <netdb.h>
-
-
-#define LOOKUP_TYPE		struct servent
-#define FUNCTION_NAME		getservbyname
-#define DATABASE_NAME		services
-#define ADD_PARAMS		const char *name, const char *proto
-#define ADD_VARIABLES		name, proto
-
-/* We are nscd, so we don't want to be talking to ourselves.  */
-#undef	USE_NSCD
-
-#include "../nss/getXXbyYY_r.c"
diff --git a/nscd/getsrvbypt_r.c b/nscd/getsrvbypt_r.c
deleted file mode 100644
index 9ca0fec407..0000000000
--- a/nscd/getsrvbypt_r.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Copyright (C) 1996-2026 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published
-   by the Free Software Foundation; version 2 of the License, or
-   (at your option) any later version.
-
-   This program 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 General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
-
-#include <netdb.h>
-
-
-#define LOOKUP_TYPE		struct servent
-#define FUNCTION_NAME		getservbyport
-#define DATABASE_NAME		services
-#define ADD_PARAMS		int port, const char *proto
-#define ADD_VARIABLES		port, proto
-
-/* We are nscd, so we don't want to be talking to ourselves.  */
-#undef	USE_NSCD
-
-#include "../nss/getXXbyYY_r.c"
diff --git a/nscd/grpcache.c b/nscd/grpcache.c
index a05f6fb6e6..1e060724f6 100644
--- a/nscd/grpcache.c
+++ b/nscd/grpcache.c
@@ -401,9 +401,9 @@ lookup (int type, union keytype key, struct group *resultbufp, char *buffer,
 	size_t buflen, struct group **grp)
 {
   if (type == GETGRBYNAME)
-    return __getgrnam_r (key.v, resultbufp, buffer, buflen, grp);
+    return getgrnam_r (key.v, resultbufp, buffer, buflen, grp);
   else
-    return __getgrgid_r (key.g, resultbufp, buffer, buflen, grp);
+    return getgrgid_r (key.g, resultbufp, buffer, buflen, grp);
 }
 
 
diff --git a/nscd/pwdcache.c b/nscd/pwdcache.c
index 715775be2f..66f9ff09a2 100644
--- a/nscd/pwdcache.c
+++ b/nscd/pwdcache.c
@@ -379,9 +379,9 @@ lookup (int type, union keytype key, struct passwd *resultbufp, char *buffer,
 	size_t buflen, struct passwd **pwd)
 {
   if (type == GETPWBYNAME)
-    return __getpwnam_r (key.v, resultbufp, buffer, buflen, pwd);
+    return getpwnam_r (key.v, resultbufp, buffer, buflen, pwd);
   else
-    return __getpwuid_r (key.u, resultbufp, buffer, buflen, pwd);
+    return getpwuid_r (key.u, resultbufp, buffer, buflen, pwd);
 }
 
 
diff --git a/nscd/servicescache.c b/nscd/servicescache.c
index aa8a80d483..46cf1a9e3b 100644
--- a/nscd/servicescache.c
+++ b/nscd/servicescache.c
@@ -329,10 +329,10 @@ lookup (int type, char *key, struct servent *resultbufp, char *buffer,
     }
 
   if (type == GETSERVBYNAME)
-    return __getservbyname_r (key, proto, resultbufp, buffer, buflen, serv);
+    return getservbyname_r (key, proto, resultbufp, buffer, buflen, serv);
 
   assert (type == GETSERVBYPORT);
-  return __getservbyport_r (atol (key), proto, resultbufp, buffer, buflen,
+  return getservbyport_r (atol (key), proto, resultbufp, buffer, buflen,
 			    serv);
 }
 
