]> sourceware.org Git - newlib-cygwin.git/commitdiff
Feature test macros: ctermid, cuserid
authorYaakov Selkowitz <yselkowi@redhat.com>
Fri, 20 May 2016 21:55:50 +0000 (16:55 -0500)
committerYaakov Selkowitz <yselkowi@redhat.com>
Mon, 23 May 2016 16:20:29 +0000 (11:20 -0500)
The proper location for these functions has always been <stdio.h>, however
XPG4 and SUSv2 did mandate a duplicate declaration in <unistd.h>.  cuserid
was dropped in SUSv3 (it was marked legacy since XPG4) and the ctermid
declaration in <unistd.h> was made optional and obsolete in SUSv4.

Fixes: https://cygwin.com/ml/cygwin/2016-05/msg00002.html
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
newlib/libc/include/stdio.h
newlib/libc/include/sys/unistd.h

index 9ab5d327bb4ff85384ea32f83f7bdd47aa72a101..866d8167d6f922f8f1133f8bb8b33b86be4b0f4a 100644 (file)
@@ -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,11 +734,11 @@ _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 :( */
-#ifdef __CYGWIN__
-#define L_ctermid       16
 #endif
+#if __POSIX_VISIBLE
+#define L_ctermid       16
 #endif
 
 #endif /* !__CUSTOM_FILE_IO__ */
index c8299bb02e67176b6c30e8298006f5818a7ab8d8..ef00575b5834cfb8a5edc4fcc02f7212719b6a6f 100644 (file)
@@ -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
This page took 0.037418 seconds and 5 git commands to generate.