aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArjun Shankar <arjun@redhat.com>2023-10-02 14:55:27 +0200
committerArjun Shankar <arjun@redhat.com>2023-10-24 12:31:00 +0200
commit7f602256ab5b85db1dbfb5f40bd109c4b37b68c8 (patch)
tree88cf9fb3bc04eae6ae9ca3816fac75d78f691740
parent1d74d2f042a405982661267394e16126db70dc5f (diff)
downloadglibc-7f602256ab5b85db1dbfb5f40bd109c4b37b68c8.zip
glibc-7f602256ab5b85db1dbfb5f40bd109c4b37b68c8.tar.gz
glibc-7f602256ab5b85db1dbfb5f40bd109c4b37b68c8.tar.bz2
Move getaddrinfo from 'posix' into 'nss'
getaddrinfo is an entry point for nss functionality. This commit moves it from 'sysdeps/posix' to 'nss', gets rid of the stub in 'posix', and moves all associated tests as well. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
-rw-r--r--nss/Makefile19
-rw-r--r--nss/Versions1
-rw-r--r--nss/getaddrinfo.c (renamed from sysdeps/posix/getaddrinfo.c)0
-rw-r--r--nss/tst-getaddrinfo.c (renamed from posix/tst-getaddrinfo.c)0
-rw-r--r--nss/tst-getaddrinfo2.c (renamed from posix/tst-getaddrinfo2.c)0
-rw-r--r--nss/tst-getaddrinfo3.c (renamed from posix/tst-getaddrinfo3.c)0
-rw-r--r--nss/tst-getaddrinfo4.c (renamed from posix/tst-getaddrinfo4.c)0
-rw-r--r--nss/tst-getaddrinfo5.c (renamed from posix/tst-getaddrinfo5.c)0
-rw-r--r--nss/tst-rfc3484-2.c (renamed from posix/tst-rfc3484-2.c)2
-rw-r--r--nss/tst-rfc3484-3.c (renamed from posix/tst-rfc3484-3.c)2
-rw-r--r--nss/tst-rfc3484.c (renamed from posix/tst-rfc3484.c)2
-rw-r--r--posix/Makefile10
-rw-r--r--posix/Versions2
-rw-r--r--posix/getaddrinfo.c38
14 files changed, 22 insertions, 54 deletions
diff --git a/nss/Makefile b/nss/Makefile
index e88754b..da5bd20 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -127,6 +127,7 @@ endif
# hosts routines:
routines += \
+ getaddrinfo \
gethstbyad \
gethstbyad_r \
gethstbynm \
@@ -138,6 +139,7 @@ routines += \
# routines
ifeq ($(have-thread-library),yes)
+CFLAGS-getaddrinfo.c += -fexceptions
CFLAGS-gethstbyad.c += -fexceptions
CFLAGS-gethstbyad_r.c += -fexceptions
CFLAGS-gethstbynm.c += -fexceptions
@@ -300,7 +302,13 @@ others-extras = $(makedb-modules)
extra-objs += $(makedb-modules:=.o)
tests-static = tst-field
-tests-internal = tst-field
+
+tests-internal := \
+ tst-field \
+ tst-rfc3484 \
+ tst-rfc3484-2 \
+ tst-rfc3484-3 \
+ # tests-internal
tests := \
bug17079 \
@@ -309,6 +317,9 @@ tests := \
test-rpcent \
testgrp \
tst-fgetsgent_r \
+ tst-getaddrinfo \
+ tst-getaddrinfo2 \
+ tst-getaddrinfo3 \
tst-gethnm \
tst-getpw \
tst-gshadow \
@@ -327,7 +338,11 @@ tests := \
tst-shadow \
# tests
-xtests = bug-erange
+xtests := \
+ bug-erange \
+ tst-getaddrinfo4 \
+ tst-getaddrinfo5 \
+ # xtests
tests-container := \
tst-initgroups1 \
diff --git a/nss/Versions b/nss/Versions
index d8c4e37..158a917 100644
--- a/nss/Versions
+++ b/nss/Versions
@@ -19,6 +19,7 @@ libc {
fgetspent; fgetspent_r;
# g*
+ getaddrinfo;
getaliasbyname; getaliasbyname_r; getaliasent; getaliasent_r;
getgrent; getgrent_r; getgrgid; getgrgid_r; getgrnam; getgrnam_r;
getgroups;
diff --git a/sysdeps/posix/getaddrinfo.c b/nss/getaddrinfo.c
index 5311249..5311249 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/nss/getaddrinfo.c
diff --git a/posix/tst-getaddrinfo.c b/nss/tst-getaddrinfo.c
index eff92a7..eff92a7 100644
--- a/posix/tst-getaddrinfo.c
+++ b/nss/tst-getaddrinfo.c
diff --git a/posix/tst-getaddrinfo2.c b/nss/tst-getaddrinfo2.c
index d8be4a8..d8be4a8 100644
--- a/posix/tst-getaddrinfo2.c
+++ b/nss/tst-getaddrinfo2.c
diff --git a/posix/tst-getaddrinfo3.c b/nss/tst-getaddrinfo3.c
index 5077f31..5077f31 100644
--- a/posix/tst-getaddrinfo3.c
+++ b/nss/tst-getaddrinfo3.c
diff --git a/posix/tst-getaddrinfo4.c b/nss/tst-getaddrinfo4.c
index a5f1f62..a5f1f62 100644
--- a/posix/tst-getaddrinfo4.c
+++ b/nss/tst-getaddrinfo4.c
diff --git a/posix/tst-getaddrinfo5.c b/nss/tst-getaddrinfo5.c
index 26a1643..26a1643 100644
--- a/posix/tst-getaddrinfo5.c
+++ b/nss/tst-getaddrinfo5.c
diff --git a/posix/tst-rfc3484-2.c b/nss/tst-rfc3484-2.c
index ce8ccd5..a5f8f82 100644
--- a/posix/tst-rfc3484-2.c
+++ b/nss/tst-rfc3484-2.c
@@ -57,7 +57,7 @@ _res_hconf_init (void)
}
#undef USE_NSCD
-#include "../sysdeps/posix/getaddrinfo.c"
+#include "getaddrinfo.c"
nss_action_list __nss_hosts_database attribute_hidden;
diff --git a/posix/tst-rfc3484-3.c b/nss/tst-rfc3484-3.c
index ecb1639..edf0b7d 100644
--- a/posix/tst-rfc3484-3.c
+++ b/nss/tst-rfc3484-3.c
@@ -57,7 +57,7 @@ _res_hconf_init (void)
}
#undef USE_NSCD
-#include "../sysdeps/posix/getaddrinfo.c"
+#include "getaddrinfo.c"
nss_action_list __nss_hosts_database attribute_hidden;
diff --git a/posix/tst-rfc3484.c b/nss/tst-rfc3484.c
index 3b2052e..5b4a0c5 100644
--- a/posix/tst-rfc3484.c
+++ b/nss/tst-rfc3484.c
@@ -57,7 +57,7 @@ _res_hconf_init (void)
}
#undef USE_NSCD
-#include "../sysdeps/posix/getaddrinfo.c"
+#include "getaddrinfo.c"
nss_action_list __nss_hosts_database attribute_hidden;
diff --git a/posix/Makefile b/posix/Makefile
index be7d319..3ab124d 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -88,7 +88,6 @@ routines := \
fpathconf \
gai_strerror \
get_child_max \
- getaddrinfo \
getegid \
geteuid \
getgid \
@@ -287,9 +286,6 @@ tests := \
tst-fnmatch7 \
tst-fork \
tst-gai_strerror \
- tst-getaddrinfo \
- tst-getaddrinfo2 \
- tst-getaddrinfo3 \
tst-getopt_long1 \
tst-glob-tilde \
tst-glob_symlinks \
@@ -351,9 +347,6 @@ tests-internal := \
bug-regex5 \
bug-regex20 \
bug-regex33 \
- tst-rfc3484 \
- tst-rfc3484-2 \
- tst-rfc3484-3 \
# tests-internal
tests-container := \
@@ -368,8 +361,6 @@ tests-time64 := \
# tests-time64
xtests := \
- tst-getaddrinfo4 \
- tst-getaddrinfo5 \
tst-sched_rr_get_interval \
# xtests
@@ -556,7 +547,6 @@ $(objpfx)config-name.h: $(..)scripts/config-uname.sh $(common-objpfx)config.make
'$(config-machine)-$(config-vendor)' > $@.new
mv -f $@.new $@
-CFLAGS-getaddrinfo.c += -fexceptions
CFLAGS-pause.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-pread.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
diff --git a/posix/Versions b/posix/Versions
index 2eedbc3..b24c7c8 100644
--- a/posix/Versions
+++ b/posix/Versions
@@ -34,7 +34,7 @@ libc {
fnmatch; fork; fpathconf; freeaddrinfo;
# g*
- getaddrinfo; getdtablesize; getegid; geteuid; getgid; getopt; getopt_long;
+ getdtablesize; getegid; geteuid; getgid; getopt; getopt_long;
getopt_long_only; getpgid; getpgrp; getpid; getppid; getsid; getuid; glob;
glob_pattern_p; globfree; group_member;
diff --git a/posix/getaddrinfo.c b/posix/getaddrinfo.c
deleted file mode 100644
index 0e36a45..0000000
--- a/posix/getaddrinfo.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Stub version of getaddrinfo function.
- Copyright (C) 1996-2023 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 <netdb.h>
-
-int
-getaddrinfo (const char *name, const char *service, const struct addrinfo *req,
- struct addrinfo **pai)
-{
- __set_errno (ENOSYS);
- return EAI_SYSTEM;
-}
-stub_warning (getaddrinfo)
-libc_hidden_def (getaddrinfo)
-
-void
-freeaddrinfo (struct addrinfo *ai)
-{
- /* Nothing. */
-}
-stub_warning (freeaddrinfo)
-libc_hidden_def (freeaddrinfo)