1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

Correct ttyslot header declaration conditions (bug 20051).

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.
This commit is contained in:
Joseph Myers
2016-05-17 15:47:20 +00:00
parent b3a810d0d3
commit 4242d9683f
4 changed files with 18 additions and 4 deletions

View 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. */