]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Correct ttyslot header declaration conditions (bug 20051).
authorJoseph Myers <joseph@codesourcery.com>
Tue, 17 May 2016 15:47:20 +0000 (15:47 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Tue, 17 May 2016 15:47:20 +0000 (15:47 +0000)
UNIX98 and XPG4 have ttyslot in <stdlib.h>.  glibc, however, has it in
<unistd.h>, for __USE_MISC || (__USE_XOPEN_EXTENDED && !__USE_UNIX98),
but no supported standard has it in <unistd.h>.

This patch adds a properly conditioned declaration to <stdlib.h> (only
enabled for the relevant standards, not for __USE_MISC or __USE_GNU).
The <unistd.h> declaration is restricted to __USE_MISC.  Some relevant
XFAILs are removed.

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).

[BZ #20051]
* posix/unistd.h [__USE_XOPEN_EXTENDED && !__USE_UNIX98]
(ttyslot): Do not declare.
* stdlib/stdlib.h [__USE_XOPEN_EXTENDED && !__USE_XOPEN2K]
(ttyslot): New prototype.
* conform/Makefile (test-xfail-XPG4/unistd.h/conform): Remove
variable.
(test-xfail-UNIX98/stdlib.h/conform): Likewise.

ChangeLog
conform/Makefile
posix/unistd.h
stdlib/stdlib.h

index 95de5970342340af8d9c7328e7f77cdb3503b0eb..ead0766e300baefd83733cb20c37c2682a8690f4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2016-05-17  Joseph Myers  <joseph@codesourcery.com>
+
+       [BZ #20051]
+       * posix/unistd.h [__USE_XOPEN_EXTENDED && !__USE_UNIX98]
+       (ttyslot): Do not declare.
+       * stdlib/stdlib.h [__USE_XOPEN_EXTENDED && !__USE_XOPEN2K]
+       (ttyslot): New prototype.
+       * conform/Makefile (test-xfail-XPG4/unistd.h/conform): Remove
+       variable.
+       (test-xfail-UNIX98/stdlib.h/conform): Likewise.
+
 2016-05-17  Stefan Liebler  <stli@linux.vnet.ibm.com>
 
        * nptl/tst-cancel17.c (do_test): Wait for finishing aio_read(&a).
index 0d610ad99f42341ebc258fbcd85a8dd6295ac1ca..ab9da786d9c137683723cbf584ff83ec32521897 100644 (file)
@@ -178,13 +178,11 @@ test-xfail-XPG4/stdlib.h/conform = yes
 test-xfail-XPG4/sys/stat.h/conform = yes
 test-xfail-XPG4/sys/wait.h/conform = yes
 test-xfail-XPG4/ucontext.h/conform = yes
-test-xfail-XPG4/unistd.h/conform = yes
 test-xfail-POSIX/sys/wait.h/conform = yes
 test-xfail-UNIX98/arpa/inet.h/conform = yes
 test-xfail-UNIX98/netdb.h/conform = yes
 test-xfail-UNIX98/netinet/in.h/conform = yes
 test-xfail-UNIX98/signal.h/conform = yes
-test-xfail-UNIX98/stdlib.h/conform = yes
 test-xfail-UNIX98/sys/wait.h/conform = yes
 test-xfail-UNIX98/ucontext.h/conform = yes
 test-xfail-XOPEN2K/semaphore.h/conform = yes
index 98ffcea649c6e2a18b086dbdb932dbf7ee396df3..625ba77da7fae8c0432f58542c875b3632823a1f 100644 (file)
@@ -781,8 +781,7 @@ extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
    with a terminal, zero if not.  */
 extern int isatty (int __fd) __THROW;
 
-#if defined __USE_MISC \
-    || (defined __USE_XOPEN_EXTENDED && !defined __USE_UNIX98)
+#ifdef __USE_MISC
 /* Return the index into the active-logins file (utmp) for
    the controlling terminal.  */
 extern int ttyslot (void) __THROW;
index d0c78facdd4505b91f195ef61dcc34e5c11b92e5..5c0c982ccf2ca908b25d593fe19cce1c9307b794 100644 (file)
@@ -912,6 +912,12 @@ extern int getloadavg (double __loadavg[], int __nelem)
      __THROW __nonnull ((1));
 #endif
 
+#if defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K
+/* Return the index into the active-logins file (utmp) for
+   the controlling terminal.  */
+extern int ttyslot (void) __THROW;
+#endif
+
 #include <bits/stdlib-float.h>
 
 /* Define some macros helping to catch buffer overflows.  */