From 339b855ff14aec73bf9527f4cc84f9a620e2bbe3 Mon Sep 17 00:00:00 2001 From: Dionna Glaze Date: Tue, 27 Jun 2017 11:07:48 -0700 Subject: [PATCH] Make gethostname, getdtablesize, mktemp, ualarm available in BSD, XOPEN_SOURCE >= 500. --- newlib/libc/include/sys/unistd.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/newlib/libc/include/sys/unistd.h b/newlib/libc/include/sys/unistd.h index 84219ca2e..ded632279 100644 --- a/newlib/libc/include/sys/unistd.h +++ b/newlib/libc/include/sys/unistd.h @@ -212,7 +212,7 @@ 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(ttyname_r, (int, char *, size_t)); int _EXFUN(unlink, (const char *__path )); int _EXFUN(usleep, (useconds_t __useconds)); int _EXFUN(vhangup, (void )); @@ -259,9 +259,9 @@ int _EXFUN(truncate, (const char *, off_t __length)); #endif #endif -#if defined(__CYGWIN__) || defined(__rtems__) +#if defined(__CYGWIN__) || defined(__rtems__) || defined(__BSD_VISIBLE) || \ + (__XSI_VISIBLE >= 500) int _EXFUN(getdtablesize, (void)); -int _EXFUN(setdtablesize, (int)); useconds_t _EXFUN(ualarm, (useconds_t __useconds, useconds_t __interval)); #if !(defined (_WINSOCK_H) || defined (_WINSOCKAPI_) || defined (__USE_W32_SOCKETS)) /* winsock[2].h defines as __stdcall, and with int as 2nd arg */ @@ -270,6 +270,10 @@ useconds_t _EXFUN(ualarm, (useconds_t __useconds, useconds_t __interval)); char * _EXFUN(mktemp, (char *)); #endif +#if defined(__CYGWIN__) || defined(__rtems__) +int _EXFUN(setdtablesize, (int)); +#endif + #if defined(__CYGWIN__) || defined(__SPU__) || defined(__rtems__) void _EXFUN(sync, (void)); #endif -- 2.13.1.611.g7e3b11ae1-goog