From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by sourceware.org (Postfix) with ESMTPS id 8BD733858D20 for ; Fri, 20 Oct 2023 13:51:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8BD733858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8BD733858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::42f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697809917; cv=none; b=W35eFMnpWzPTmnGm5tZRcRGOp7yvF+okk3N4MUAJrn6sBNY3+xBB6k8TUc3lieLKjMpI+uCIc0TFo186r9Rh4ifP/Ih+VWvqih5vnoRmExTrm5AQRaK96MF89FX+Qc14+Su+DoyPEVk9PMj3TYXOZY7asHiKMQrWq0rHNyN9764= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697809917; c=relaxed/simple; bh=QewnPH470w6AileOBGrg+CcYQBRDMvxYKfK1AOAOJiQ=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=CdvLnKzUr6WWw81tY7pc7a9B67HX0oUCidDycr1FLVAu3xYyNcVuyvM0gvWDSNnF4hw1wQoFD2Q4iexObJmtAhT4QpYUGt6Ji4LbutL1z65rRlXMgRfurtDrzustQ0mTS23qLX+sHD8XbXooUlnfsgQqHVWpGI7NYprMmH9GF0Q= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-6b3c2607d9bso771898b3a.1 for ; Fri, 20 Oct 2023 06:51:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697809913; x=1698414713; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=24Sc62dU2nhDj5pT3Oj5q1sVuQHrIus5wSIjfPLokmM=; b=MQoWqEBfgKy0Fs5X/Ns7ecy2GR+yOjioOknOX+Pi1uTxHnMarvEe6VQZv+YsNGVIRs EesEg5JOFNq88CmpIumRKlYLo1aD4wArryJPUrKt3r+Vyf4fj0XMQ0Z+0CJaqbLKdx7/ k2NUjZMzyoTxNHaUE+CkEGkVpn73LNBivPzxZR84covREDqF4iH04AqWC+bkAcwpQeHh SwXHY7sq6remx3mKoKun9e24i3bvSIMY7LVxoinod0V0tBfjQRn4XJ+FNYsc7zR3xr+R 0+0+ySk4botSTo7r1KBdCVt8De54xu/+Ek111ibeiZ9kvfEZuQMCiOs1bGoGL/NNbIXG autw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697809913; x=1698414713; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=24Sc62dU2nhDj5pT3Oj5q1sVuQHrIus5wSIjfPLokmM=; b=JEOuS4VTJn/aJuM1/eE9m79aEJ+Y0BtYRmB9RMn1crHKrIT3w4uOwNTZSFtb0mWCZC T5BJ+gPTRqj3+tDdKOpXh3zh/nAY2Sp0TIQiEkJcLX+PxnfVc7Pf+nxiNK5c5iak8t+T BBCjKTpC1Nn1iqE2tBA+sa7arBMxwwOcHdctSDwCxo2JI1Cao9peZx7lraIEHXoyP0Jf Oibyrvy8Q+HKaOd+cWV9WRjEql246k3wkNKi380/gr1FbupZqlwHPDlVYQAzIRnfTSN0 qjumC5QUN6u7Tx2MSqKtTchI6A/2zy61b9aRvX5jX3JfMu3gJLe1wLjY5rA6luKRsfZG OQqw== X-Gm-Message-State: AOJu0YyoY1ujVzqK4yntibfRCZ6HBZj/O6MudrHnyxqcuhmDz2RroDSV riOBb/AamCE4+h5ASF2Q8GL4VIkBZ94IrmOFC33tNQ== X-Google-Smtp-Source: AGHT+IFHYpgxFpwGJeDmWR0t76eqjvEweiIX6yI/Ob0CkDH+Q4Vqgn5M3ATobIwT/CAGlIBPyONoRA== X-Received: by 2002:a05:6a21:71c7:b0:16b:f71d:1b82 with SMTP id ay7-20020a056a2171c700b0016bf71d1b82mr1776161pzc.34.1697809913511; Fri, 20 Oct 2023 06:51:53 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c3:a647:b489:1074:73d4:b147? ([2804:1b3:a7c3:a647:b489:1074:73d4:b147]) by smtp.gmail.com with ESMTPSA id jf22-20020a170903269600b001b9e9edbf43sm1544761plb.171.2023.10.20.06.51.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Oct 2023 06:51:52 -0700 (PDT) Message-ID: Date: Fri, 20 Oct 2023 10:51:50 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 15/16] Move getaddrinfo from 'posix' into 'nss' Content-Language: en-US To: Arjun Shankar , libc-alpha@sourceware.org References: <20231002130150.1497733-1-arjun@redhat.com> <20231002130150.1497733-16-arjun@redhat.com> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <20231002130150.1497733-16-arjun@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 02/10/23 09:55, Arjun Shankar wrote: > 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. LGTM, thanks. Reviewed-by: Adhemerval Zanella > --- > nss/Makefile | 19 ++++++++++++-- > nss/Versions | 1 + > {sysdeps/posix => nss}/getaddrinfo.c | 0 > {posix => nss}/tst-getaddrinfo.c | 0 > {posix => nss}/tst-getaddrinfo2.c | 0 > {posix => nss}/tst-getaddrinfo3.c | 0 > {posix => nss}/tst-getaddrinfo4.c | 0 > {posix => nss}/tst-getaddrinfo5.c | 0 > {posix => nss}/tst-rfc3484-2.c | 2 +- > {posix => nss}/tst-rfc3484-3.c | 2 +- > {posix => nss}/tst-rfc3484.c | 2 +- > posix/Makefile | 10 -------- > posix/Versions | 2 +- > posix/getaddrinfo.c | 38 ---------------------------- > 14 files changed, 22 insertions(+), 54 deletions(-) > rename {sysdeps/posix => nss}/getaddrinfo.c (100%) > rename {posix => nss}/tst-getaddrinfo.c (100%) > rename {posix => nss}/tst-getaddrinfo2.c (100%) > rename {posix => nss}/tst-getaddrinfo3.c (100%) > rename {posix => nss}/tst-getaddrinfo4.c (100%) > rename {posix => nss}/tst-getaddrinfo5.c (100%) > rename {posix => nss}/tst-rfc3484-2.c (99%) > rename {posix => nss}/tst-rfc3484-3.c (98%) > rename {posix => nss}/tst-rfc3484.c (98%) > delete mode 100644 posix/getaddrinfo.c > > diff --git a/nss/Makefile b/nss/Makefile > index e88754bf51..da5bd207aa 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 d8c4e373c9..158a9175a4 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 > similarity index 100% > rename from sysdeps/posix/getaddrinfo.c > rename to nss/getaddrinfo.c > diff --git a/posix/tst-getaddrinfo.c b/nss/tst-getaddrinfo.c > similarity index 100% > rename from posix/tst-getaddrinfo.c > rename to nss/tst-getaddrinfo.c > diff --git a/posix/tst-getaddrinfo2.c b/nss/tst-getaddrinfo2.c > similarity index 100% > rename from posix/tst-getaddrinfo2.c > rename to nss/tst-getaddrinfo2.c > diff --git a/posix/tst-getaddrinfo3.c b/nss/tst-getaddrinfo3.c > similarity index 100% > rename from posix/tst-getaddrinfo3.c > rename to nss/tst-getaddrinfo3.c > diff --git a/posix/tst-getaddrinfo4.c b/nss/tst-getaddrinfo4.c > similarity index 100% > rename from posix/tst-getaddrinfo4.c > rename to nss/tst-getaddrinfo4.c > diff --git a/posix/tst-getaddrinfo5.c b/nss/tst-getaddrinfo5.c > similarity index 100% > rename from posix/tst-getaddrinfo5.c > rename to nss/tst-getaddrinfo5.c > diff --git a/posix/tst-rfc3484-2.c b/nss/tst-rfc3484-2.c > similarity index 99% > rename from posix/tst-rfc3484-2.c > rename to nss/tst-rfc3484-2.c > index ce8ccd5f38..a5f8f82c04 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 > similarity index 98% > rename from posix/tst-rfc3484-3.c > rename to nss/tst-rfc3484-3.c > index ecb163963f..edf0b7db2e 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 > similarity index 98% > rename from posix/tst-rfc3484.c > rename to nss/tst-rfc3484.c > index 3b2052eb54..5b4a0c5b82 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 be7d319394..3ab124d040 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 2eedbc3e79..b24c7c87ff 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 0e36a4564c..0000000000 > --- 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 > - . */ > - > -#include > -#include > - > -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)