From patchwork Thu Jun 29 19:48:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yaakov Selkowitz X-Patchwork-Id: 106653 Delivered-To: patch@linaro.org Received: by 10.182.135.102 with SMTP id pr6csp5090469obb; Thu, 29 Jun 2017 12:49:14 -0700 (PDT) X-Received: by 10.84.231.201 with SMTP id g9mr11805257pln.86.1498765754071; Thu, 29 Jun 2017 12:49:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498765754; cv=none; d=google.com; s=arc-20160816; b=hDMOSWZejSdrAyh5gVux9zzDoSj5O9QHN5EupFBwBXX3SeEcCr+gUY8iPf6AoB1fEn 4Awsmp6gR4M7PpZpi2KngwAhZ5X3gQjJSq7PmQtjUDxCc1v7tIsKWEPGaqM6/VEKZELM M+vDyhcH4n0Qlw+ZaRMKj7wO132kNv4cqz48XLOTMJy4WHVI7TKneHcryHd0TeD/9eSv 2DUwdghdjw0dIH4qBg95C/U5ng9C7wSjdZLJAfPAB7lDASWwxe22PDl6Z1FcB9q/Yu/p SJbgEzxM4i7MEin5NAQKQcaBIgOfiHslzDyA/HrFrv0s4wHn6nCGP60L8ZztN+Zx8xUr dNbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:to:from:dkim-filter:dmarc-filter :delivered-to:sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=ikJWL2LRHBtcCeU/plTBHIIA2IPKP70PNKynwPBLw0s=; b=SY8ZN2vgk6dS3qEmFDTd3bNCoC+/YNVSyxiYZO2VNPfDdY4+phGxB50uDCPDloe4u0 M5gLS16MsNcYj2kkyoY5foOhqSxTlr0GqP2JyWHDCW7VOc1cgHvBsb0kob60SV4qINEw 3lS+NeHlR9IwTehwe6PZnaAScE5Eqgtx8EDOPDV1eYDE4wyi5mMCjzm3FvMu5l8X7HuZ Jy6Dmdb0xBuyK/7gXfw+4y7ruA9kSJZY8RloV9WgKz7akf77L2UQvbDt8Q8VrxBgofVb t3P4/y4lNYxaygJ2iNoTVIu9LjVUDKYgpCoN52U4YFTCEuxKXjw0iSYaw90aGE0H06jv HfAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.b=NcUiZnXD; spf=pass (google.com: domain of newlib-return-14769-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=newlib-return-14769-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id g12si4691749pln.489.2017.06.29.12.49.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Jun 2017 12:49:14 -0700 (PDT) Received-SPF: pass (google.com: domain of newlib-return-14769-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 header.b=NcUiZnXD; spf=pass (google.com: domain of newlib-return-14769-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=newlib-return-14769-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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; q=dns; s= default; b=GVekcWlEoVnp7fRnZOOZF7+llyXJu3ay4EPPvM8RvIvOjWswSLoQ6 OF2r5mhB4hcmOXoWnRwCi8EUcsGZlMPKWcg1po4PGPBID7DZgM/RGQrrntd5EkNf jtZsbppTJuG1AieKsaLlXqbHInVDIgMJGuuYGA7E7aOwDyZn/xrlTE= 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; s=default; bh=Np1EdOj2HifLYwfDOBbEfBJ44+0=; b=NcUiZnXDsf3VLTwjj5rjU2IhsZAc pBr73deFCIpvG0bqneIVHB/WmXl18dIQW5GL8dFfLcHHECERxicMBXLbd8cteWb4 edcNhVrXdLDWgtz/imqkmiTolUv5TWj4Sylf/3wbDY5gS7iK+kImdDpOeQjrIaVw 9/wigJL8oOHdugg= Received: (qmail 8514 invoked by alias); 29 Jun 2017 19:48:54 -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 8279 invoked by uid 89); 29 Jun 2017 19:48:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= 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 ESMTP; Thu, 29 Jun 2017 19:48:40 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0356F73B2D for ; Thu, 29 Jun 2017 19:48:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0356F73B2D Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=yselkowi@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 0356F73B2D Received: from localhost.localdomain (ovpn-120-18.rdu2.redhat.com [10.10.120.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8C1B37BB4A for ; Thu, 29 Jun 2017 19:48:35 +0000 (UTC) From: Yaakov Selkowitz To: newlib@sourceware.org Subject: [PATCH] Feature test macros overhaul: unistd.h, part 2 Date: Thu, 29 Jun 2017 14:48:25 -0500 Message-Id: <20170629194825.6648-1-yselkowi@redhat.com> This fixes commit f70aad3de4d845f8b720010a2f8817db842d81e8 as well as some other functions which were never properly guarded. Signed-off-by: Yaakov Selkowitz --- newlib/libc/include/sys/unistd.h | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) -- 2.12.3 diff --git a/newlib/libc/include/sys/unistd.h b/newlib/libc/include/sys/unistd.h index 859671ae9..75f8a51df 100644 --- a/newlib/libc/include/sys/unistd.h +++ b/newlib/libc/include/sys/unistd.h @@ -207,15 +207,21 @@ int _EXFUN(setuid, (uid_t __uid )); void _EXFUN(setusershell, (void)); #endif unsigned _EXFUN(sleep, (unsigned int __seconds )); +#if __XSI_VISIBLE void _EXFUN(swab, (const void *__restrict, void *__restrict, ssize_t)); +#endif long _EXFUN(sysconf, (int __name )); pid_t _EXFUN(tcgetpgrp, (int __fildes )); int _EXFUN(tcsetpgrp, (int __fildes, pid_t __pgrp_id )); char * _EXFUN(ttyname, (int __fildes )); int _EXFUN(ttyname_r, (int, char *, size_t)); int _EXFUN(unlink, (const char *__path )); +#if __XSI_VISIBLE >= 500 && __POSIX_VISIBLE < 200809 || __BSD_VISIBLE int _EXFUN(usleep, (useconds_t __useconds)); +#endif +#if __BSD_VISIBLE int _EXFUN(vhangup, (void )); +#endif _READ_WRITE_RETURN_TYPE _EXFUN(write, (int __fd, const void *__buf, size_t __nbyte )); #ifdef __CYGWIN__ @@ -252,27 +258,34 @@ _READ_WRITE_RETURN_TYPE _EXFUN(_write, (int __fd, const void *__buf, size_t __nb int _EXFUN(_execve, (const char *__path, char * const __argv[], char * const __envp[] )); #endif -#if defined(__CYGWIN__) || defined(__rtems__) || defined(__aarch64__) || defined (__arm__) || defined(__sh__) || defined(__SPU__) #if !defined(__INSIDE_CYGWIN__) +#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 500 int _EXFUN(ftruncate, (int __fd, off_t __length)); +#endif +#if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >= 500 int _EXFUN(truncate, (const char *, off_t __length)); #endif #endif -#if defined(__BSD_VISIBLE) || (__XSI_VISIBLE >= 500) +#if __BSD_VISIBLE || __POSIX_VISIBLE < 200112 int _EXFUN(getdtablesize, (void)); +#endif +#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >= 500 useconds_t _EXFUN(ualarm, (useconds_t __useconds, useconds_t __interval)); +#endif + +#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 500 #if !(defined (_WINSOCK_H) || defined (_WINSOCKAPI_) || defined (__USE_W32_SOCKETS)) /* winsock[2].h defines as __stdcall, and with int as 2nd arg */ int _EXFUN(gethostname, (char *__name, size_t __len)); #endif #endif -#if defined(__CYGWIN__) || defined(__rtems__) +#if __MISC_VISIBLE int _EXFUN(setdtablesize, (int)); #endif -#if defined(__CYGWIN__) || defined(__SPU__) || defined(__rtems__) +#if __BSD_VISIBLE || __XSI_VISIBLE >= 500 void _EXFUN(sync, (void)); #endif