Print this page
5058 standards(5) Duplicate line in a table
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man5/standards.5
+++ new/usr/src/man/man5/standards.5
1 1 '\" te
2 2 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
3 3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 -.TH STANDARDS 5 "Jan 14, 2004"
6 +.TH STANDARDS 5 "Nov 08, 2014"
7 7 .SH NAME
8 8 standards, ANSI, C, C++, ISO, POSIX, POSIX.1, POSIX.2, SUS, SUSv2, SUSv3, SVID,
9 9 SVID3, XNS, XNS4, XNS5, XPG, XPG3, XPG4, XPG4v2 \- standards and specifications
10 10 supported by Solaris
11 11 .SH DESCRIPTION
12 12 .sp
13 13 .LP
14 14 Solaris 10 supports IEEE Std 1003.1 and IEEE Std 1003.2, commonly known as
15 15 POSIX.1 and POSIX.2, respectively. The following table lists each version of
16 16 these standards with a brief description and the SunOS or Solaris release that
17 17 first conformed to it.
18 18 .sp
19 19
20 20 .sp
21 21 .TS
22 22 c c c
23 23 l l l .
24 24 POSIX Standard Description Release
25 25 _
26 26 POSIX.1-1988 system interfaces and headers SunOS 4.1
27 27 _
28 28 POSIX.1-1990 POSIX.1-1988 update Solaris 2.0
29 29 _
30 30 POSIX.1b-1993 realtime extensions Solaris 2.4
31 31 _
32 32 POSIX.1c-1996 threads extensions Solaris 2.6
33 33 _
34 34 POSIX.2-1992 shell and utilities Solaris 2.5
35 35 _
36 36 POSIX.2a-1992 interactive shell and utilities Solaris 2.5
37 37 _
38 38 POSIX.1-2001 T{
39 39 POSIX.1-1990, POSIX.1b-1993, POSIX.1c-1996, POSIX.2-1992, and POSIX.2a-1992 updates
40 40 T} Solaris 10
41 41 .TE
42 42
43 43 .sp
44 44 .LP
45 45 Solaris 10 also supports the X/Open Common Applications Environment (CAE)
46 46 Portability Guide Issue 3 (XPG3) and Issue 4 (XPG4); Single UNIX Specification
47 47 (SUS, also known as XPG4v2); Single UNIX Specification, Version 2 (SUSv2); and
48 48 Single UNIX Specification, Version 3 (SUSv3). Both XPG4 and SUS include
49 49 Networking Services Issue 4 (XNS4). SUSv2 includes Networking Services Issue 5
50 50 (XNS5).
51 51 .sp
52 52 .LP
53 53 The following table lists each X/Open specification with a brief description
54 54 and the SunOS or Solaris release that first conformed to it.
55 55 .sp
56 56
57 57 .sp
58 58 .TS
59 59 c c c
60 60 c c c .
61 61 X/Open CAE
62 62 _
63 63 Specification Description Release
64 64 _
65 65 XPG3 T{
66 66 superset of POSIX.1-1988 containing utilities from SVID3
67 67 T} SunOS 4.1
68 68 _
69 69 XPG4 T{
70 70 superset of POSIX.1-1990, POSIX.2-1992, and POSIX.2a-1992 containing extensions to POSIX standards from XPG3
71 71 T} Solaris 2.4
72 72 _
73 73 SUS (XPG4v2) T{
74 74 superset of XPG4 containing historical BSD interfaces widely used by common application packages
75 75 T} Solaris 2.6
76 76 _
77 77 XNS4 sockets and XTI interfaces Solaris 2.6
78 78 _
79 79 SUSv2 T{
80 80 superset of SUS extended to support POSIX.1b-1993, POSIX.1c-1996, and ISO/IEC 9899 (C Standard) Amendment 1
81 81 T} Solaris 7
82 82 _
83 83 XNS5 T{
84 84 superset and LP64-clean derivative of XNS4.
85 85 T} Solaris 7
86 86 _
87 87 SUSv3 same as POSIX.1-2001 Solaris 10
88 88 .TE
89 89
90 90 .sp
91 91 .LP
92 92 The XNS4 specification is safe for use only in ILP32 (32-bit) environments and
93 93 should not be used for LP64 (64-bit) application environments. Use XNS5 or
94 94 SUSv3, which have LP64-clean interfaces that are portable across ILP32 and LP64
95 95 environments. Solaris releases 7 through 10 support both the ILP32 and LP64
96 96 environments.
97 97 .sp
98 98 .LP
99 99 Solaris releases 7 through 10 have been branded to conform to The Open Group's
100 100 UNIX 98 Product Standard. Solaris 10 has been branded to conform to The Open
101 101 Group's UNIX 03 Product Standard.
102 102 .sp
103 103 .LP
104 104 Solaris releases 2.0 through 10 support the interfaces specified by the System
105 105 V Interface Definition, Third Edition, Volumes 1 through 4 (SVID3). Note,
106 106 however, that since the developers of this specification (UNIX Systems
107 107 Laboratories) are no longer in business and since this specification defers to
108 108 POSIX and X/Open CAE specifications, there is some disagreement about what is
109 109 currently required for conformance to this specification.
110 110 .sp
111 111 .LP
112 112 When \fBSun Studio C Compiler 5.6\fR is installed, Solaris releases 2.0 through
113 113 10 support the ANSI X3.159-1989 Programming Language - C and ISO/IEC 9899:1990
114 114 Programming Language - C (C) interfaces.
115 115 .sp
116 116 .LP
117 117 When \fBSun Studio C Compiler 5.6\fR is installed, Solaris releases 7 through
118 118 10 support ISO/IEC 9899:1990 Amendment 1:1995: C Integrity.
119 119 .sp
120 120 .LP
121 121 When \fBSun Studio C Compiler 5.6\fR is installed, Solaris 10 supports ISO/IEC
122 122 9899:1999 Programming Languages - C.
123 123 .sp
124 124 .LP
125 125 When \fBSun Studio C++ Compiler 5.6\fR is installed, Solaris releases 2.5.1
126 126 through 10 support ISO/IEC 14882:1998 Programming Languages - C++. Unsupported
127 127 features of that standard are described in the compiler README file.
128 128 .SS "Utilities"
129 129 .sp
130 130 .LP
131 131 If the behavior required by POSIX.2, POSIX.2a, XPG4, SUS, or SUSv2 conflicts
132 132 with historical Solaris utility behavior, the original Solaris version of the
133 133 utility is unchanged; a new version that is standard-conforming has been
134 134 provided in \fB/usr/xpg4/bin\fR. If the behavior required by POSIX.1-2001 or
135 135 SUSv3 conflicts with historical Solaris utility behavior, a new version that is
136 136 standard-conforming has been provided in \fB/usr/xpg4/bin\fR or in
137 137 \fB/usr/xpg6/bin\fR. If the behavior required by POSIX.1-2001 or SUSv3
138 138 conflicts with POSIX.2, POSIX.2a, SUS, or SUSv2, a new version that is SUSv3
139 139 standard-conforming has been provided in \fB/usr/xpg6/bin\fR.
140 140 .sp
141 141 .LP
142 142 An application that wants to use standard-conforming utilitues must set the
143 143 \fBPATH\fR (\fBsh\fR(1) or \fBksh\fR(1)) or \fBpath\fR (\fBcsh\fR(1))
144 144 environment variable to specify the directories listed below in the order
145 145 specified to get the appropriate utilities:
146 146 .sp
147 147 .ne 2
148 148 .na
149 149 \fBSVID3, XPG3\fR
150 150 .ad
151 151 .sp .6
152 152 .RS 4n
153 153 .RS +4
154 154 .TP
155 155 1.
156 156 \fB/usr/ccs/bin\fR
157 157 .RE
158 158 .RS +4
159 159 .TP
160 160 2.
161 161 \fB/usr/bin\fR
162 162 .RE
163 163 .RS +4
164 164 .TP
165 165 3.
166 166 directory containing binaries for your compiler
167 167 .RE
168 168 .RS +4
169 169 .TP
170 170 4.
171 171 other directories containing binaries needed by the application
172 172 .RE
173 173 .RE
174 174
175 175 .sp
176 176 .ne 2
177 177 .na
178 178 \fBPOSIX.2, POSIX.2a, SUS, SUSv2, XPG4\fR
179 179 .ad
180 180 .sp .6
181 181 .RS 4n
182 182 .RS +4
183 183 .TP
184 184 1.
185 185 \fB/usr/xpg4/bin\fR
186 186 .RE
187 187 .RS +4
188 188 .TP
189 189 2.
190 190 \fB/usr/ccs/bin\fR
191 191 .RE
192 192 .RS +4
193 193 .TP
194 194 3.
195 195 \fB/usr/bin\fR
196 196 .RE
197 197 .RS +4
198 198 .TP
199 199 4.
200 200 directory containing binaries for your compiler
201 201 .RE
202 202 .RS +4
203 203 .TP
204 204 5.
205 205 other directories containing binaries needed by the application
206 206 .RE
207 207 .RE
208 208
209 209 .sp
210 210 .ne 2
211 211 .na
212 212 \fBPOSIX.1-2001, SUSv3\fR
213 213 .ad
214 214 .sp .6
215 215 .RS 4n
216 216 .RS +4
217 217 .TP
218 218 1.
219 219 \fB/usr/xpg6/bin\fR
220 220 .RE
221 221 .RS +4
222 222 .TP
223 223 2.
224 224 \fB/usr/xpg4/bin\fR
225 225 .RE
226 226 .RS +4
227 227 .TP
228 228 3.
229 229 \fB/usr/ccs/bin\fR
230 230 .RE
231 231 .RS +4
232 232 .TP
233 233 4.
234 234 \fB/usr/bin\fR
235 235 .RE
236 236 .RS +4
237 237 .TP
238 238 5.
239 239 directory containing binaries for your compiler
240 240 .RE
241 241 .RS +4
242 242 .TP
243 243 6.
244 244 other directories containing binaries needed by the application
245 245 .RE
246 246 .RE
247 247
248 248 .SS "Feature Test Macros"
249 249 .sp
250 250 .LP
251 251 Feature test macros are used by applications to indicate additional sets of
252 252 features that are desired beyond those specified by the C standard. If an
253 253 application uses only those interfaces and headers defined by a particular
254 254 standard (such as POSIX or X/Open CAE), then it need only define the
255 255 appropriate feature test macro specified by that standard. If the application
256 256 is using interfaces and headers not defined by that standard, then in addition
257 257 to defining the appropriate standard feature test macro, it must also define
258 258 \fB__EXTENSIONS__\fR. Defining \fB__EXTENSIONS__\fR provides the application
259 259 with access to all interfaces and headers not in conflict with the specified
260 260 standard. The application must define \fB__EXTENSIONS__\fR either on the
261 261 compile command line or within the application source files.
262 262 .SS "1989 ANSI C, 1990 ISO C, 1999 ISO C"
263 263 .sp
264 264 .LP
265 265 No feature test macros need to be defined to indicate that an application is a
266 266 conforming C application.
267 267 .SS "ANSI/ISO C++"
268 268 .sp
269 269 .LP
270 270 ANSI/ISO C++ does not define any feature test macros. If the standard C++
271 271 announcement macro \fB__cplusplus\fR is predefined to value 199711 or greater,
272 272 the compiler operates in a standard-conforming mode, indicating C++ standards
273 273 conformance. The value 199711 indicates conformance to ISO/IEC 14882:1998, as
274 274 required by that standard. (As noted above, conformance to the standard is
275 275 incomplete.) A standard-conforming mode is not available with compilers prior
276 276 to Sun WorkShop C++ 5.0.
277 277 .sp
278 278 .LP
279 279 C++ bindings are not defined for POSIX or X/Open CAE, so specifying feature
280 280 test macros such as \fB_POSIX_SOURCE\fR, \fB_POSIX_C_SOURCE\fR, and
281 281 \fB_XOPEN_SOURCE\fR can result in compilation errors due to conflicting
282 282 requirements of standard C++ and those specifications.
283 283 .SS "POSIX"
284 284 .sp
285 285 .LP
286 286 Applications that are intended to be conforming POSIX.1 applications must
287 287 define the feature test macros specified by the standard before including any
288 288 headers. For the standards listed below, applications must define the feature
289 289 test macros listed. Application writers must check the corresponding standards
290 290 for other macros that can be queried to determine if desired options are
291 291 supported by the implementation.
292 292 .sp
293 293
294 294 .sp
295 295 .TS
296 296 c c
297 297 l l .
298 298 \fBPOSIX Standard\fR \fBFeature Test Macros\fR
299 299 _
300 300 POSIX.1-1990 \fB_POSIX_SOURCE\fR
301 301 _
302 302 T{
303 303 POSIX.1-1990 and POSIX.2-1992 C-Language Bindings Option
304 304 T} \fB_POSIX_SOURCE\fR and \fB_POSIX_C_SOURCE=2\fR
305 305 POSIX.1b-1993 \fB_POSIX_C_SOURCE=199309L\fR
306 306 _
307 307 POSIX.1c-1996 \fB_POSIX_C_SOURCE=199506L\fR
308 308 _
309 309 POSIX.1-2001 \fB_POSIX_C_SOURCE=200112L\fR
310 310 .TE
311 311
312 312 .SS "SVID3"
313 313 .sp
314 314 .LP
315 315 The SVID3 specification does not specify any feature test macros to indicate
316 316 that an application is written to meet SVID3 requirements. The SVID3
317 317 specification was written before the C standard was completed.
318 318 .SS "X/Open CAE"
319 319 .sp
320 320 .LP
321 321 To build or compile an application that conforms to one of the X/Open CAE
322 322 specifications, use the following guidelines. Applications need not set the
323 323 POSIX feature test macros if they require both CAE and POSIX functionality.
324 324 .sp
325 325 .ne 2
326 326 .na
327 327 \fBXPG3\fR
328 328 .ad
329 329 .RS 16n
330 330 The application must define \fB_XOPEN_SOURCE\fR. If \fB_XOPEN_SOURCE\fR is
331 331 defined with a value, the value must be less than 500.
332 332 .RE
333 333
334 334 .sp
335 335 .ne 2
336 336 .na
337 337 \fBXPG4\fR
338 338 .ad
339 339 .RS 16n
340 340 The application must define \fB_XOPEN_SOURCE\fR and set \fB_XOPEN_VERSION=4\fR.
341 341 If \fB_XOPEN_SOURCE\fR is defined with a value, the value must be less than
342 342 500.
343 343 .RE
344 344
345 345 .sp
346 346 .ne 2
347 347 .na
348 348 \fBSUS (XPG4v2)\fR
349 349 .ad
350 350 .RS 16n
351 351 The application must define \fB_XOPEN_SOURCE\fR and set
352 352 \fB_XOPEN_SOURCE_EXTENDED=1\fR. If \fB_XOPEN_SOURCE\fR is defined with a value,
353 353 the value must be less than 500.
354 354 .RE
355 355
356 356 .sp
357 357 .ne 2
358 358 .na
359 359 \fBSUSv2\fR
360 360 .ad
361 361 .RS 16n
362 362 The application must define \fB_XOPEN_SOURCE=500\fR.
363 363 .RE
364 364
365 365 .sp
366 366 .ne 2
367 367 .na
368 368 \fBSUSv3\fR
369 369 .ad
370 370 .RS 16n
371 371 The application must define \fB_XOPEN_SOURCE=600\fR.
372 372 .RE
373 373
374 374 .SS "Compilation"
375 375 .sp
376 376 .LP
377 377 A POSIX.1 (1988-1996)-, XPG4-, SUS-, or SUSv2-conforming implementation must
378 378 include an ANSI X3.159-1989 (ANSI C Language) standard-conforming compilation
379 379 system and the \fBcc\fR and \fBc89\fR utilities. A POSIX.1-2001- or
380 380 SUSv3-conforming implementation must include an ISO/IEC 99899:1999 (1999 ISO C
381 381 Language) standard-conforming compilation system and the \fBc99\fR utility.
382 382 Solaris 10 was tested with the \fBcc\fR, \fBc89\fR, and \fBc99\fR utilities and
383 383 the compilation environment provided by \fBSun Studio C Compiler 5.6\fR.
384 384 .sp
385 385 .LP
386 386 When \fBcc\fR is used to link applications, \fB/usr/lib/values-xpg4.o\fR must
387 387 be specified on any link/load command line, unless the application is
388 388 POSIX.1-2001- or SUSv3-conforming, in which case \fB/usr/lib/values-xpg6.o\fR
389 389 must be specified on any link/load compile line. The preferred way to build
390 390 applications, however, is described in the table below.
391 391 .sp
392 392 .LP
393 393 An XNS4- or XNS5-conforming application must include \fB-l\fR \fBXNS\fR on any
394 394 link/load command line in addition to defining the feature test macros
395 395 specified for SUS or SUSv2, respectively.
396 396 .sp
397 397 .LP
398 398 If the compiler suppports the \fBredefine_extname\fR pragma feature (the \fBSun
399 399 Studio C Compiler 5.6\fR compilers define the macro
400 400 \fB__PRAGMA_REDEFINE_EXTNAME\fR to indicate that it supports this feature),
401 401 then the standard headers use \fB#pragma\fR \fBredefine_extname\fR directives
402 402 to properly map function names onto library entry point names. This mapping
403 403 provides full support for ISO C, POSIX, and X/Open namespace reservations.
404 404 .sp
405 405 .LP
406 406 If this pragma feature is not supported by the compiler, the headers use the
407 407 \fB#define\fR directive to map internal function names onto appropriate library
408 408 entry point names. In this instance, applications should avoid using the
409 409 explicit 64-bit file offset symbols listed on the \fBlf64\fR(5) manual page,
410 410 since these names are used by the implementation to name the alternative entry
411 411 points.
412 412 .sp
413 413 .LP
414 414 When using \fBSun Studio C Compiler 5.6\fR compilers, applications conforming
415 415 to the specifications listed above should be compiled using the utilities and
416 416 flags indicated in the following table:
417 417 .sp
418 418 .in +2
419 419 .nf
420 420 Specification Compiler/Flags Feature Test Macros
421 421 _________________________________________________________________________
422 422 1989 ANSI C and 1990 ISO C c89 none
423 423 _________________________________________________________________________
424 424 1999 ISO C c99 none
425 425 _________________________________________________________________________
426 426 SVID3 cc -Xt -xc99=none none
427 427 _________________________________________________________________________
428 428 POSIX.1-1990 c89 _POSIX_SOURCE
↓ open down ↓ |
412 lines elided |
↑ open up ↑ |
429 429 _________________________________________________________________________
430 430 POSIX.1-1990 and POSIX.2-1992 c89 _POSIX_SOURCE and
431 431 C-Language Bindings Option POSIX_C_SOURCE=2
432 432 _________________________________________________________________________
433 433 POSIX.1b-1993 c89 _POSIX_C_SOURCE=199309L
434 434 _________________________________________________________________________
435 435 POSIX.1c-1996 c89 _POSIX_C_SOURCE=199506L
436 436 _________________________________________________________________________
437 437 POSIX.1-2001 c99 _POSIX_C_SOURCE=200112L
438 438 _________________________________________________________________________
439 -POSIX.1c-1996 c89 _POSIX_C_SOURCE=199506L
440 -_________________________________________________________________________
441 439 CAE XPG3 cc -Xa -xc99=none _XOPEN_SOURCE
442 440 _________________________________________________________________________
443 441 CAE XPG4 c89 _XOPEN_SOURCE and
444 442 _XOPEN_VERSION=4
445 443 _________________________________________________________________________
446 444 SUS (CAE XPG4v2) c89 _XOPEN_SOURCE and
447 445 (includes XNS4) _XOPEN_SOURCE_EXTENDED=1
448 446 _________________________________________________________________________
449 447 SUSv2 (includes XNS5) c89 _XOPEN_SOURCE=500
450 448 _________________________________________________________________________
451 449 SUSv3 c99 _XOPEN_SOURCE=600
452 450 .fi
453 451 .in -2
454 452 .sp
455 453
456 454 .sp
457 455 .LP
458 456 For platforms supporting the LP64 (64-bit) programming environment,
459 457 SUSv2-conforming LP64 applications using XNS5 library calls should be built
460 458 with command lines of the form:
461 459 .sp
462 460 .in +2
463 461 .nf
464 462 c89 $(getconf XBS5_LP64_OFF64_CFLAGS) -D_XOPEN_SOURCE=500 \e
465 463 $(getconf XBS5_LP64_OFF64_LDFLAGS) foo.c -o foo \e
466 464 $(getconf XBS5_LP64_OFF64_LIBS) -lxnet
467 465 .fi
468 466 .in -2
469 467
470 468 .sp
471 469 .LP
472 470 Similar SUSv3-conforming LP64 applications should be built with command lines
473 471 of the form:
474 472 .sp
475 473 .in +2
476 474 .nf
477 475 c99 $(getconf POSIX_V6_LP64_OFF64_CFLAGS) -D_XOPEN_SOURCE=600 \e
478 476 $(getconf POSIX_V6_LP64_OFF64_LDFLAGS) foo.c -o foo \e
479 477 $(getconf POSIX_V6_LP64_OFF64_LIBS) -lxnet
480 478 .fi
481 479 .in -2
482 480
483 481 .SS "SUSv3"
484 482 .sp
485 483 .ne 2
486 484 .na
487 485 \fB\fBc99\fR\fR
488 486 .ad
489 487 .RS 28n
490 488 \fB_XOPEN_SOURCE=600\fR
491 489 .RE
492 490
493 491 .SH SEE ALSO
494 492 .sp
495 493 .LP
496 494 \fBcsh\fR(1), \fBksh\fR(1), \fBsh\fR(1), \fBexec\fR(2), \fBsysconf\fR(3C),
497 495 \fBsystem\fR(3C), \fBenviron\fR(5), \fBlf64\fR(5)
↓ open down ↓ |
47 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX