From: Yaakov Selkowitz <yselkowi@redhat.com>
To: newlib@sourceware.org
Subject: [PATCH] Feature test macros overhaul: unistd.h, part 2
Date: Thu, 29 Jun 2017 19:48:00 -0000 [thread overview]
Message-ID: <20170629194825.6648-1-yselkowi@redhat.com> (raw)
This fixes commit f70aad3de4d845f8b720010a2f8817db842d81e8 as well as some
other functions which were never properly guarded.
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
---
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
next reply other threads:[~2017-06-29 19:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-29 19:48 Yaakov Selkowitz [this message]
2017-06-30 8:49 ` Corinna Vinschen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170629194825.6648-1-yselkowi@redhat.com \
--to=yselkowi@redhat.com \
--cc=newlib@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).