This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Restore _POSIX2_C_VERSION definition (bug 438)


My review of conformtest expectations for POSIX showed up that the
_POSIX2_C_VERSION macro, required by POSIX and XPG standards before
2001, was missing in unistd.h, having been removed on 2003-04-03
despite those standards still being supported.  This patch adds it
back.  As it's in the implementation namespace, there's no need for it
to be conditional, and other such macros aren't conditional in this
header either.

Tested for x86_64 and x86 (testsuite).  Note that this *does* change
the installed libraries, because it affects the sysconf support
(present all along) for _SC_2_C_VERSION.

2015-05-21  Joseph Myers  <joseph@codesourcery.com>

	[BZ #438]
	* posix/unistd.h (_POSIX2_C_VERSION): New macro.
	* conform/Makefile (test-xfail-POSIX/unistd.h/conform): Remove
	variable.

diff --git a/conform/Makefile b/conform/Makefile
index bdd7203..6d5dbcb 100644
--- a/conform/Makefile
+++ b/conform/Makefile
@@ -211,7 +211,6 @@ test-xfail-XPG4/termios.h/conform = yes
 test-xfail-XPG4/ucontext.h/conform = yes
 test-xfail-XPG4/unistd.h/conform = yes
 test-xfail-XPG4/utmpx.h/conform = yes
-test-xfail-POSIX/unistd.h/conform = yes
 test-xfail-POSIX/sys/wait.h/conform = yes
 test-xfail-UNIX98/arpa/inet.h/conform = yes
 test-xfail-UNIX98/fcntl.h/conform = yes
diff --git a/posix/unistd.h b/posix/unistd.h
index 80a5b86..1b52930 100644
--- a/posix/unistd.h
+++ b/posix/unistd.h
@@ -66,6 +66,9 @@ __BEGIN_DECLS
 /* The utilities on GNU systems also correspond to this version.  */
 #define _POSIX2_VERSION	__POSIX2_THIS_VERSION
 
+/* This symbol was required until the 2001 edition of POSIX.  */
+#define	_POSIX2_C_VERSION	__POSIX2_THIS_VERSION
+
 /* If defined, the implementation supports the
    C Language Bindings Option.  */
 #define	_POSIX2_C_BIND	__POSIX2_THIS_VERSION

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]