From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@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 19:48:00 -0000 Message-Id: <20170629194825.6648-1-yselkowi@redhat.com> X-SW-Source: 2017/txt/msg00531.txt.bz2 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(-) 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 -- 2.12.3