This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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]

Re: sysconf cleanup


This change breaks backward compatibility with Cygwin's sysconf.cc
implementation.

On Nov 21 21:19, Howland Craig D (Craig) wrote:
> _SC_XBS5_ILP32_OFF32, _SC_XBS5_ILP32_OFFBIG, and _SC_XBS5_LPBIG_OFFBIG
> cases ran into a problem with their values being defined, but not
> as numbers.  (They are redefined as other macros which never get
> values.)

They are defined as their newer counterparts _SC_V6_ILP32_OFF32 (92),
_SC_V6_ILP32_OFFBIG (93), _SC_V6_LP64_OFF64 (94) and _SC_V6_LPBIG_OFFBIG
(95) so I don't understand why they should "never get values".  I don't
see a reason to give them different values than their counterparts.

> Since they didn't work before, I didn't bother to try and fix them.

How did they not work before?  They have valid values.

> As part of this, I had to correct 3 of the _SC_ values for so-called
> "legacy" defines in sys/unistd.h to remove duplication.  (Opengroup
> shows different returns for the legacy items, so the duplication that
> was
> in place made no sense.)

I don't see what you mean.  The XBS5 values are all equivalent to the
V6 values in sys/unistd.h as well as in sys/features.h.  You can use
one or the other.

What probably *should* be fixed are the definitions in sys/features.h so
that either the three _POSIX_V6_* values are defined to -1 instead of
being undefined, or to undefine the _XBS5_* values if their _POSIX_V6_
counterpart is undefined.  Below is a patch using the first solution.

But please don't change the values for the _SC_XBS5_* defines.


Corinna


	* libc/include/sys/features.h (_POSIX_V6_ILP32_OFF32): Always define.
	(_POSIX_V6_LP64_OFF64): Ditto.
	(_POSIX_V6_LPBIG_OFFBIG): Ditto.


Index: libc/include/sys/features.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/sys/features.h,v
retrieving revision 1.14
diff -u -p -r1.14 features.h
--- libc/include/sys/features.h	16 Oct 2008 21:53:58 -0000	1.14
+++ libc/include/sys/features.h	22 Nov 2008 11:58:29 -0000
@@ -150,13 +150,13 @@ extern "C" {
 /* #define _POSIX2_PBS_TRACK			    -1 */
 #define _POSIX2_SW_DEV				200112L
 #define _POSIX2_UPE				200112L
-/* #define _POSIX_V6_ILP32_OFF32		    -1 */
+#define _POSIX_V6_ILP32_OFF32			    -1
 #define _XBS5_ILP32_OFF32			_POSIX_V6_ILP32_OFF32
 #define _POSIX_V6_ILP32_OFFBIG			     1
 #define _XBS5_ILP32_OFFBIG			_POSIX_V6_ILP32_OFFBIG
-/* #define _POSIX_V6_LP64_OFF64			    -1 */
+#define _POSIX_V6_LP64_OFF64			    -1
 #define _XBS5_LP64_OFF64			_POSIX_V6_LP64_OFF64
-/* #define _POSIX_V6_LPBIG_OFFBIG		    -1 */
+#define _POSIX_V6_LPBIG_OFFBIG			    -1
 #define _XBS5_LPBIG_OFFBIG			_POSIX_V6_LPBIG_OFFBIG
 #define _XOPEN_CRYPT				     1
 #define _XOPEN_ENH_I18N				     1

-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat


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