From patchwork Thu May 12 17:07:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 621690 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 3r5KF02xGBz9sdm for ; Fri, 13 May 2016 03:08:04 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=lo//OFCj; 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:in-reply-to:message-id :references:mime-version:content-type; q=dns; s=default; b=UJozj taBsy0F231w5A3is30QgsfOS1ZluF6dnRNvXLFB1KtNJDFdWC29k9OyXtPTvBaFc aLPoF9LHUEeyGdMtq/Cqd6qcOXifnDcnqhNA/tIcQcH8Za1phCm97pYNcYgg2brQ jJZTDE259MVDH9K+pC5t75zD3KeHK5KTI8vT3U= 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:in-reply-to:message-id :references:mime-version:content-type; s=default; bh=Ufx5F7Jf1WU /OzNcmsYFRanBhrA=; b=lo//OFCjv4WC8k9/diZ5pPKPtc1QDR3qeUWavtT7r0M CSYZ5+YIzljcl7B12PVp7ElQB3yfDqnAo7oqeml8YoNbRw22SIH2uwuCqjV/iiiX 88rQGZQbNfTEH0IfdbiNEpzI8xmQR1xPBApdxtizlrSRjReW/tbrA+YmTqUQpsyo = Received: (qmail 106715 invoked by alias); 12 May 2016 17:07:55 -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 106704 invoked by uid 89); 12 May 2016 17:07:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=conditioned, __nonnull, POSIX2008, posix2008 X-HELO: relay1.mentorg.com Date: Thu, 12 May 2016 17:07:39 +0000 From: Joseph Myers To: Subject: Re: Correct ttyslot header declaration conditions (bug 20051) In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Here is an updated version of this patch, with an XFAIL removal moved here from the gethostname patch (which has been committed without the XFAIL removal that depended on this patch). Correct ttyslot header declaration conditions (bug 20051). UNIX98 and XPG4 have ttyslot in . glibc, however, has it in , for __USE_MISC || (__USE_XOPEN_EXTENDED && !__USE_UNIX98), but no supported standard has it in . This patch adds a properly conditioned declaration to (only enabled for the relevant standards, not for __USE_MISC or __USE_GNU). The declaration is restricted to __USE_MISC. The conformtest expectation is adjusted not to expect it for XPG3, only for XPG4 and UNIX98. Some relevant XFAILs are removed. Tested for x86_64 and x86 (testsuite, and that installed stripped shared libraries are unchanged by the patch). 2016-05-12 Joseph Myers [BZ #20051] * posix/unistd.h [__USE_XOPEN_EXTENDED && !__USE_UNIX98] (ttyslot): Do not declare. * stdlib/stdlib.h [__USE_XOPEN_EXTENDED && !__USE_XOPEN2K] (ttyslot): New prototype. * conform/data/stdlib.h-data (ttyslot): Do not expect for [XPG3]. * conform/Makefile (test-xfail-XPG4/unistd.h/conform): Remove variable. (test-xfail-UNIX98/stdlib.h/conform): Likewise. diff --git a/conform/Makefile b/conform/Makefile index b5a1ee8..a11642f 100644 --- a/conform/Makefile +++ b/conform/Makefile @@ -181,13 +181,11 @@ test-xfail-XPG4/stdlib.h/conform = yes test-xfail-XPG4/sys/stat.h/conform = yes test-xfail-XPG4/sys/wait.h/conform = yes test-xfail-XPG4/ucontext.h/conform = yes -test-xfail-XPG4/unistd.h/conform = yes test-xfail-POSIX/sys/wait.h/conform = yes test-xfail-UNIX98/arpa/inet.h/conform = yes test-xfail-UNIX98/netdb.h/conform = yes test-xfail-UNIX98/netinet/in.h/conform = yes test-xfail-UNIX98/signal.h/conform = yes -test-xfail-UNIX98/stdlib.h/conform = yes test-xfail-UNIX98/sys/wait.h/conform = yes test-xfail-UNIX98/ucontext.h/conform = yes test-xfail-XOPEN2K/semaphore.h/conform = yes diff --git a/conform/data/stdlib.h-data b/conform/data/stdlib.h-data index abe296a..423358d 100644 --- a/conform/data/stdlib.h-data +++ b/conform/data/stdlib.h-data @@ -162,7 +162,7 @@ function {long long int} strtoll (const char*, char**, int) function {unsigned long long int} strtoull (const char*, char**, int) #endif function int system (const char*) -#if defined XPG3 || defined XPG4 || defined UNIX98 +#if defined XPG4 || defined UNIX98 function int ttyslot (void) #endif #if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 diff --git a/posix/unistd.h b/posix/unistd.h index 98ffcea..625ba77 100644 --- a/posix/unistd.h +++ b/posix/unistd.h @@ -781,8 +781,7 @@ extern int ttyname_r (int __fd, char *__buf, size_t __buflen) with a terminal, zero if not. */ extern int isatty (int __fd) __THROW; -#if defined __USE_MISC \ - || (defined __USE_XOPEN_EXTENDED && !defined __USE_UNIX98) +#ifdef __USE_MISC /* Return the index into the active-logins file (utmp) for the controlling terminal. */ extern int ttyslot (void) __THROW; diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h index d0c78fa..5c0c982 100644 --- a/stdlib/stdlib.h +++ b/stdlib/stdlib.h @@ -912,6 +912,12 @@ extern int getloadavg (double __loadavg[], int __nelem) __THROW __nonnull ((1)); #endif +#if defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K +/* Return the index into the active-logins file (utmp) for + the controlling terminal. */ +extern int ttyslot (void) __THROW; +#endif + #include /* Define some macros helping to catch buffer overflows. */