xref: /titanic_44/usr/src/lib/libc/inc/xpg6.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*
23*7c478bd9Sstevel@tonic-gate  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
24*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
25*7c478bd9Sstevel@tonic-gate  */
26*7c478bd9Sstevel@tonic-gate 
27*7c478bd9Sstevel@tonic-gate #ifndef _XPG6_H
28*7c478bd9Sstevel@tonic-gate #define	_XPG6_H
29*7c478bd9Sstevel@tonic-gate 
30*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*7c478bd9Sstevel@tonic-gate 
32*7c478bd9Sstevel@tonic-gate /*
33*7c478bd9Sstevel@tonic-gate  * This is an OS/Net Consolidation PRIVATE header.
34*7c478bd9Sstevel@tonic-gate  */
35*7c478bd9Sstevel@tonic-gate 
36*7c478bd9Sstevel@tonic-gate /*
37*7c478bd9Sstevel@tonic-gate  * __xpg6 (C99/SUSv3) was first introduced in Solaris 10.
38*7c478bd9Sstevel@tonic-gate  *
39*7c478bd9Sstevel@tonic-gate  * C99/SUSv3 behavior control bits for __xpg6 variable defined
40*7c478bd9Sstevel@tonic-gate  * in port/gen/xpg6.c.
41*7c478bd9Sstevel@tonic-gate  * Use these with extreme care.
42*7c478bd9Sstevel@tonic-gate  *
43*7c478bd9Sstevel@tonic-gate  * Please follow these basic rules for using these bits and
44*7c478bd9Sstevel@tonic-gate  * don't convolute their meaning.
45*7c478bd9Sstevel@tonic-gate  *
46*7c478bd9Sstevel@tonic-gate  * The basic idea here is the upper 16 bits (default_off)
47*7c478bd9Sstevel@tonic-gate  * enable/disable existing Solaris behaviors that conflict with
48*7c478bd9Sstevel@tonic-gate  * the C99 or SUSv3 standards.  When these bits are on you
49*7c478bd9Sstevel@tonic-gate  * are restoring an existing Solaris behavior and no longer
50*7c478bd9Sstevel@tonic-gate  * in strict C99/SUSv3 conformance mode.
51*7c478bd9Sstevel@tonic-gate  *
52*7c478bd9Sstevel@tonic-gate  * The lower 16 bits (default_on) are C99/SUSv3 behaviors
53*7c478bd9Sstevel@tonic-gate  * which are strictly conforming behaviors as far as the
54*7c478bd9Sstevel@tonic-gate  * C99/SUSv3 standards are concerned.  When these bits are on
55*7c478bd9Sstevel@tonic-gate  * you are in C99/SUSv3 conforming mode.  When these bits are off
56*7c478bd9Sstevel@tonic-gate  * you have turned off C99/SUSv3 conforming mode and are using
57*7c478bd9Sstevel@tonic-gate  * previous Solaris behavior.
58*7c478bd9Sstevel@tonic-gate  *
59*7c478bd9Sstevel@tonic-gate  * _C99SUSv3_mode_ON and _C99SUSv3_mode_OFF are two meta-definitions
60*7c478bd9Sstevel@tonic-gate  * which are the most likely modes to run Solaris in.
61*7c478bd9Sstevel@tonic-gate  * However, this frame work allows for other possible behaviors.
62*7c478bd9Sstevel@tonic-gate  *
63*7c478bd9Sstevel@tonic-gate  * The default mode of libc is _C99SUSv3_mode_OFF.
64*7c478bd9Sstevel@tonic-gate  * A C99/SUSv3 conforming application should be compiled
65*7c478bd9Sstevel@tonic-gate  * with the XPG6 standards conforming C compiler utility (c99) which
66*7c478bd9Sstevel@tonic-gate  * adds an object file that contains an alternate definition
67*7c478bd9Sstevel@tonic-gate  * for __xpg6 (_C99SUSv3_mode_ON) thus enabling C99/SUSv3 standards
68*7c478bd9Sstevel@tonic-gate  * conforming mode.
69*7c478bd9Sstevel@tonic-gate  */
70*7c478bd9Sstevel@tonic-gate 
71*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_default_off_reserved15	0x80000000
72*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_default_off_reserved14	0x40000000
73*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_default_off_reserved13	0x20000000
74*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_default_off_reserved12	0x10000000
75*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_default_off_reserved11	0x08000000
76*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_default_off_reserved10	0x04000000
77*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_default_off_reserved09	0x02000000
78*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_default_off_reserved08	0x01000000
79*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_default_off_reserved07	0x00800000
80*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_default_off_reserved06	0x00400000
81*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_default_off_reserved05	0x00200000
82*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_default_off_reserved04	0x00100000
83*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_default_off_reserved03	0x00080000
84*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_default_off_reserved02	0x00040000
85*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_default_off_reserved01	0x00020000
86*7c478bd9Sstevel@tonic-gate /*
87*7c478bd9Sstevel@tonic-gate  * If set then %f & %F print Inf/NaN;
88*7c478bd9Sstevel@tonic-gate  *	  else print inf/nan & INF/NAN, respectively.
89*7c478bd9Sstevel@tonic-gate  */
90*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_mixed_case_Inf_and_NaN	0x00010000
91*7c478bd9Sstevel@tonic-gate 
92*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_default_on_reserved15		0x00008000
93*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_default_on_reserved14		0x00004000
94*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_default_on_reserved13		0x00002000
95*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_default_on_reserved12		0x00001000
96*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_default_on_reserved11		0x00000800
97*7c478bd9Sstevel@tonic-gate /*
98*7c478bd9Sstevel@tonic-gate  * If set, math library entry points present in SUSv2 deal with exceptional
99*7c478bd9Sstevel@tonic-gate  * cases as per SUSv3 spec where math_errhandling is set to MATH_ERREXCEPT;
100*7c478bd9Sstevel@tonic-gate  * otherwise they behave as per SUSv2 spec.
101*7c478bd9Sstevel@tonic-gate  */
102*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_math_errexcept		0x00000400
103*7c478bd9Sstevel@tonic-gate /*
104*7c478bd9Sstevel@tonic-gate  * If set, when filename is a null pointer, freopen(NULL, mode, ...) will
105*7c478bd9Sstevel@tonic-gate  * attempt to change the mode of the stream to that specified by mode, as if
106*7c478bd9Sstevel@tonic-gate  * the name of the file currently associated with the stream had been used;
107*7c478bd9Sstevel@tonic-gate  * otherwise freopen(NULL, ...) will fail.
108*7c478bd9Sstevel@tonic-gate  */
109*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_freopen_NULL_filename		0x00000200
110*7c478bd9Sstevel@tonic-gate /*
111*7c478bd9Sstevel@tonic-gate  * If set,
112*7c478bd9Sstevel@tonic-gate  *	- strfmon() uses int_* members for %i
113*7c478bd9Sstevel@tonic-gate  *	- strfmon() handles the case n_sep_by_space == 2 as SUSv3 expects,
114*7c478bd9Sstevel@tonic-gate  *	which is different from it does in non SUSv3 mode.
115*7c478bd9Sstevel@tonic-gate  */
116*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_strfmon			0x00000100
117*7c478bd9Sstevel@tonic-gate /*
118*7c478bd9Sstevel@tonic-gate  * If set, pow(+/-1,+/-Inf) & pow(1,NaN) return 1; otherwise NaN is returned.
119*7c478bd9Sstevel@tonic-gate  * Analogous comment applies to powf and powl.
120*7c478bd9Sstevel@tonic-gate  */
121*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_pow_treats_Inf_as_an_even_int	0x00000080
122*7c478bd9Sstevel@tonic-gate /*
123*7c478bd9Sstevel@tonic-gate  * If set, logb(subnormal) returns (double) ilogb(subnormal); otherwise
124*7c478bd9Sstevel@tonic-gate  * logb(subnormal) returns logb(DBL_MIN).  Analogous comment applies to
125*7c478bd9Sstevel@tonic-gate  * logbf and logbl.
126*7c478bd9Sstevel@tonic-gate  */
127*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_logb_subnormal_is_like_ilogb	0x00000040
128*7c478bd9Sstevel@tonic-gate /*
129*7c478bd9Sstevel@tonic-gate  * If set, ilogb(0/+Inf/-Inf/NaN) raises FE_INVALID as per SUSv3; otherwise
130*7c478bd9Sstevel@tonic-gate  * no exception is raised.  Analogous comment applies to ilogbf and ilogbl.
131*7c478bd9Sstevel@tonic-gate  */
132*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_ilogb_0InfNaN_raises_invalid	0x00000020
133*7c478bd9Sstevel@tonic-gate /*
134*7c478bd9Sstevel@tonic-gate  * If set, the range for strptime() and getdate() %S specifier is [0-60]
135*7c478bd9Sstevel@tonic-gate  * seconds; otherwise the range is [0-61] seconds.
136*7c478bd9Sstevel@tonic-gate  */
137*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_strptime_seconds		0x00000010
138*7c478bd9Sstevel@tonic-gate 
139*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_default_on_reserved03		0x00000008
140*7c478bd9Sstevel@tonic-gate 
141*7c478bd9Sstevel@tonic-gate /*
142*7c478bd9Sstevel@tonic-gate  * Use SUSv3 version numbers for _SC_VERSION and _SC_XOPEN_XCU_VERSION.
143*7c478bd9Sstevel@tonic-gate  */
144*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_XPG6_sysconf_version		0x00000004
145*7c478bd9Sstevel@tonic-gate /*
146*7c478bd9Sstevel@tonic-gate  * Include /usr/xpg6/bin in PATH.
147*7c478bd9Sstevel@tonic-gate  */
148*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_XPG6_pathing			0x00000002
149*7c478bd9Sstevel@tonic-gate /*
150*7c478bd9Sstevel@tonic-gate  * If set strtod() and wcstod() recognize hex floating point constants.
151*7c478bd9Sstevel@tonic-gate  */
152*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_recognize_hexfp		0x00000001
153*7c478bd9Sstevel@tonic-gate 
154*7c478bd9Sstevel@tonic-gate /*
155*7c478bd9Sstevel@tonic-gate  * __xpg6 = _C99SUSv3_mode_ON   enables C99/SUSv3 standards conformance mode.
156*7c478bd9Sstevel@tonic-gate  * __xpg6 = _C99SUSv3_mode_OFF disables C99/SUSv3 standards conformance mode.
157*7c478bd9Sstevel@tonic-gate  */
158*7c478bd9Sstevel@tonic-gate 
159*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_mode_ON	0x0000FFFF
160*7c478bd9Sstevel@tonic-gate #define	_C99SUSv3_mode_OFF	0xFFFF0000
161*7c478bd9Sstevel@tonic-gate 
162*7c478bd9Sstevel@tonic-gate #if !defined(_ASM)
163*7c478bd9Sstevel@tonic-gate extern unsigned int __xpg6;
164*7c478bd9Sstevel@tonic-gate #endif
165*7c478bd9Sstevel@tonic-gate 
166*7c478bd9Sstevel@tonic-gate #endif /* _XPG6_H */
167