From patchwork Fri Jun 12 21:48:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 483770 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 6CFBA1402B4 for ; Sat, 13 Jun 2015 07:48:42 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=sourceware.org header.i=@sourceware.org header.b=TB6AqauF; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=QiWfQRhwx5mmMeLWE+k44o1L8gkgZ HAz6RHBpCYGE07msmu9b8JjlGdOKFNHr17ra/qmjgIbLTbmSjZ6+jwVX+vsWXvxa Tsx5g22wDnP5+Y+Akdyp8DCGt+6aDiUJda89mCOhUnuqkJUuZVZAtr2uIellhnt8 dxkm3/oW5tA/Zc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=gXVLaVkYwjdFhLz4/mRD546XuhY=; b=TB6 AqauFqxDyc2ne0Gnc0s4A6Se02LQ7Qrfan3WgS1demhuFgqcQD//XmqQ3aMqJDt9 V+NiNCN4E8SQhpDey0Dfv41BhXIy5NjJskIGAZcXCrfJ71Xh9L2Yg7nMWw5z3rIS tGuVtHfyPzCOHDqSiPC/sPImsNQvF79yZlX34/qY= Received: (qmail 75965 invoked by alias); 12 Jun 2015 21:48:34 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 75954 invoked by uid 89); 12 Jun 2015 21:48:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Date: Fri, 12 Jun 2015 21:48:26 +0000 From: Joseph Myers To: Subject: Fix netdb.h addrinfo namespace (bug 18529) Message-ID: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 netdb.h declares interfaces such as getaddrinfo if __USE_POSIX, i.e. POSIX.1:1990 or later. However, these interfaces were new in the 2001 edition of POSIX, although the header was in XPG4 and UNIX98, so they should not be declared for XPG4 or UNIX98. (This produces spurious linknamespace test failures, although there are other failures for this header as well for the same standards so this patch doesn't remove any XFAILs.) This patch corrects the condition, and the conform/ test expectations which were similarly wrong. Tested for x86_64 and x86 (testsuite, and that installed stripped shared libraries are unchanged by the patch). 2015-06-12 Joseph Myers [BZ #18529] * resolv/netdb.h [__USE_POSIX]: Change condition to [__USE_XOPEN2K]. * conform/data/netdb.h-data [XPG4 || UNIX98] (struct addrinfo): Do not expect. [XPG4 || UNIX98] (AI_PASSIVE): Likewise. [XPG4 || UNIX98] (AI_CANONNAME): Likewise. [XPG4 || UNIX98] (AI_NUMERICHOST): Likewise. [XPG4 || UNIX98] (AI_V4MAPPED): Likewise. [XPG4 || UNIX98] (AI_ALL): Likewise. [XPG4 || UNIX98] (AI_ADDRCONFIG): Likewise. [XPG4 || UNIX98] (AI_NUMERICSERV): Likewise. [XPG4 || UNIX98] (NI_NOFQDN): Likewise. [XPG4 || UNIX98] (NI_NUMERICHOST): Likewise. [XPG4 || UNIX98] (NI_NAMEREQD): Likewise. [XPG4 || UNIX98] (NI_NUMERICSERV): Likewise. [XPG4 || UNIX98] (NI_DGRAM): Likewise. [XPG4 || UNIX98] (EAI_AGAIN): Likewise. [XPG4 || UNIX98] (EAI_BADFLAGS): Likewise. [XPG4 || UNIX98] (EAI_FAIL): Likewise. [XPG4 || UNIX98] (EAI_FAMILY): Likewise. [XPG4 || UNIX98] (EAI_MEMORY): Likewise. [XPG4 || UNIX98] (EAI_NONAME): Likewise. [XPG4 || UNIX98] (EAI_SERVICE): Likewise. [XPG4 || UNIX98] (EAI_SOCKTYPE): Likewise. [XPG4 || UNIX98] (EAI_SYSTEM): Likewise. [XPG4 || UNIX98] (EAI_SYSTEM): Likewise. [XPG4 || UNIX98] (freeaddrinfo): Likewise. [XPG4 || UNIX98] (gai_strerror): Likewise. [XPG4 || UNIX98] (getaddrinfo): Likewise. [XPG4 || UNIX98] (getnameinfo): Likewise. diff --git a/conform/data/netdb.h-data b/conform/data/netdb.h-data index c5fd257..63a42ae 100644 --- a/conform/data/netdb.h-data +++ b/conform/data/netdb.h-data @@ -44,6 +44,7 @@ macro NO_RECOVERY macro TRY_AGAIN #endif +#if !defined XPG4 && !defined UNIX98 type {struct addrinfo} element {struct addrinfo} int ai_flags element {struct addrinfo} int ai_family @@ -78,18 +79,23 @@ macro EAI_SERVICE macro EAI_SOCKTYPE macro EAI_SYSTEM macro EAI_OVERFLOW +#endif function void endhostent (void) function void endnetent (void) function void endprotoent (void) function void endservent (void) +#if !defined XPG4 && !defined UNIX98 function void freeaddrinfo (struct addrinfo*) function {const char*} gai_strerror (int) function int getaddrinfo (const char*, const char*, const struct addrinfo*, struct addrinfo**) +#endif function {struct hostent*} gethostbyaddr (const void*, socklen_t, int) function {struct hostent*} gethostbyname (const char*) function {struct hostent*} gethostent (void) +#if !defined XPG4 && !defined UNIX98 function int getnameinfo (const struct sockaddr*, socklen_t, char*, socklen_t, char*, socklen_t, int) +#endif function {struct netent*} getnetbyaddr (uint32_t, int) function {struct netent*} getnetbyname (const char*) function {struct netent*} getnetent (void) diff --git a/resolv/netdb.h b/resolv/netdb.h index fe8f3ba..6ff11a1 100644 --- a/resolv/netdb.h +++ b/resolv/netdb.h @@ -562,7 +562,7 @@ extern int rresvport_af (int *__alport, sa_family_t __af); /* Extension from POSIX.1g. */ -#ifdef __USE_POSIX +#ifdef __USE_XOPEN2K /* Structure to contain information about address of a service provider. */ struct addrinfo {