From patchwork Fri May 20 22:11:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yaakov Selkowitz X-Patchwork-Id: 68307 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp117768qge; Fri, 20 May 2016 15:12:14 -0700 (PDT) X-Received: by 10.66.148.42 with SMTP id tp10mr8317358pab.159.1463782334830; Fri, 20 May 2016 15:12:14 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id vc14si30647641pac.232.2016.05.20.15.12.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 May 2016 15:12:14 -0700 (PDT) Received-SPF: pass (google.com: domain of newlib-return-13839-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of newlib-return-13839-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=newlib-return-13839-patch=linaro.org@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=RKZf1MfHYsPQlAWLegELPHtSBftmdQU Q+owXYIQHecaZ+/GeDb3CK5x/oMRwaSqKKPPCQ95HJODtHd9eyIvjZ+B1pynUn8U smgxAKhc/ZuFT3AAn8ZA9CPk3/Yqc2CKFlPDuJ2Jda1WmYAIvF9SJe6IqSCGc8sU V7U9Q32c5fWI= 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:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=oep34iuk+Ue/0vjxWa6ooqeC/gw=; b=NoqCW cNy8fczpCRfa+qpch1IszRkrZR4MARNty5e4MA0BGpevLq0yNjb03fighP2Frk1a KC2sQcfnIl6ctq3ujGS6JoHnE/hjXp7QpfrvR2j9iC3rqrluldlynBPOhrPkOP76 mHkdm1ZhgqUzxw4yD6DTTUK89NsIsclugHAVDM= Received: (qmail 14091 invoked by alias); 20 May 2016 22:12:06 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Delivered-To: mailing list newlib@sourceware.org Received: (qmail 14068 invoked by uid 89); 20 May 2016 22:12:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=3112, sk:yselkow, mandate X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 20 May 2016 22:11:55 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9F7518F316 for ; Fri, 20 May 2016 22:11:53 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-30.rdu2.redhat.com [10.10.116.30]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4KMBqM4021181 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 20 May 2016 18:11:53 -0400 From: Yaakov Selkowitz To: newlib@sourceware.org Subject: [PATCH] Feature test macros: ctermid, cuserid Date: Fri, 20 May 2016 17:11:44 -0500 Message-Id: <1463782304-12104-1-git-send-email-yselkowi@redhat.com> In-Reply-To: References: The proper location for these functions has always been , however XPG4 and SUSv2 did mandate a duplicate declaration in . cuserid was dropped in SUSv3 (it was marked legacy since XPG4) and the ctermid declaration in was made optional and obsolete in SUSv4. Fixes: https://cygwin.com/ml/cygwin/2016-05/msg00002.html Signed-off-by: Yaakov Selkowitz --- newlib/libc/include/stdio.h | 10 +++++++++- newlib/libc/include/sys/unistd.h | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) -- 2.8.0 diff --git a/newlib/libc/include/stdio.h b/newlib/libc/include/stdio.h index 9ab5d32..3122746 100644 --- a/newlib/libc/include/stdio.h +++ b/newlib/libc/include/stdio.h @@ -164,6 +164,12 @@ typedef _fpos64_t fpos64_t; #endif #endif +#if __POSIX_VISIBLE +char * _EXFUN(ctermid, (char *)); +#endif +#if __XSI_VISIBLE && __XSI_VISIBLE < 600 +char * _EXFUN(cuserid, (char *)); +#endif FILE * _EXFUN(tmpfile, (void)); char * _EXFUN(tmpnam, (char *)); #if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112 @@ -728,8 +734,10 @@ _ELIDABLE_INLINE int __sputc_r(struct _reent *_ptr, int _c, FILE *_p) { __swbuf_r(_REENT, (int)(x), p) == EOF : (*(p)->_p = (x), (p)->_p++, 0)) #endif -#if __XSI_VISIBLE +#if __GNU_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 600) #define L_cuserid 9 /* posix says it goes in stdio.h :( */ +#endif +#if __POSIX_VISIBLE #ifdef __CYGWIN__ #define L_ctermid 16 #endif diff --git a/newlib/libc/include/sys/unistd.h b/newlib/libc/include/sys/unistd.h index c8299bb..ef00575 100644 --- a/newlib/libc/include/sys/unistd.h +++ b/newlib/libc/include/sys/unistd.h @@ -31,8 +31,12 @@ int _EXFUN(close, (int __fildes )); #if __POSIX_VISIBLE >= 199209 size_t _EXFUN(confstr, (int __name, char *__buf, size_t __len)); #endif +#if __XSI_VISIBLE && __XSI_VISIBLE < 700 char * _EXFUN(ctermid, (char *__s )); +#endif +#if __XSI_VISIBLE && __XSI_VISIBLE < 600 char * _EXFUN(cuserid, (char *__s )); +#endif #if __BSD_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 500) int _EXFUN(daemon, (int nochdir, int noclose)); #endif