From patchwork Thu Dec 11 15:38:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 4181 Received: (qmail 9893 invoked by alias); 11 Dec 2014 15:39:08 -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 9882 invoked by uid 89); 11 Dec 2014 15:39:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e24smtp04.br.ibm.com Message-ID: <5489BA91.3010706@linux.vnet.ibm.com> Date: Thu, 11 Dec 2014 13:38:57 -0200 From: Adhemerval Zanella User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: "GNU C. Library" Subject: [PATCH, RFC] Fix __sendmmsg prototype guards X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14121115-0029-0000-0000-000002460B14 Hi, On make check for powerpc, I now seeing scanf15 and scanf17 test builds failing with following warning: In file included from ../inet/netinet/in.h:23:0, from ../include/netinet/in.h:3, from ../resolv/resolv.h:57, from ../include/resolv.h:12, from ../nptl/descr.h:39, from ../sysdeps/powerpc/nptl/tls.h:58, from ../sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h:24, from ../sysdeps/unix/sysv/linux/lowlevellock-futex.h:22, from ../sysdeps/nptl/lowlevellock.h:23, from ../sysdeps/nptl/bits/stdio-lock.h:23, from ../libio/libio.h:149, from ../libio/stdio.h:74, from scanf17.c:11: ../include/sys/socket.h:95:24: error: ‘struct mmsghdr’ declared inside parameter list [-Werror] unsigned int __vlen, int __flags); And I think it will shown in any architecture that is using the default nptl/lowlevellock.h instead of the arch-specific ones. In 'socket/sys/socket.h' file the function declaration is guarded with __USE_GNU, while for 'include/sys/socket.h' it is not. Usually this issue will not shown, mainly because usually arch-specific lowlevellock.h does not include sysdep.h. However for powerpc case, which does use it, along with testcase undefining '_GNU_SOURCE' it results in an error. This patch fixes by adding the __USE_GNU guards on include/sys/socket.h. Tested on powerpc64 and powerpc32. --- * include/sys/socket.h (__sendmmsg): Add __USE_GNU guards on function prototype. -- diff --git a/include/sys/socket.h b/include/sys/socket.h index 9caf1bb..99f6036 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -91,9 +91,11 @@ extern ssize_t __libc_sendmsg (int __fd, const struct msghdr *__message, extern ssize_t __sendmsg (int __fd, const struct msghdr *__message, int __flags) attribute_hidden; +#ifdef __USE_GNU extern int __sendmmsg (int __fd, struct mmsghdr *__vmessages, unsigned int __vlen, int __flags); libc_hidden_proto (__sendmmsg) +#endif /* Receive a message as described by MESSAGE from socket FD. Returns the number of bytes read or -1 for errors. */