<sys/cdefs.h>: Add some definitions for IEEE 1003.1-2008.
[dragonfly.git] / share / man / man7 / standards.7
1 .\"
2 .\" Copyright (c) 2010
3 .\"     The DragonFly Project.  All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\"
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in
13 .\"    the documentation and/or other materials provided with the
14 .\"    distribution.
15 .\" 3. Neither the name of The DragonFly Project nor the names of its
16 .\"    contributors may be used to endorse or promote products derived
17 .\"    from this software without specific, prior written permission.
18 .\"
19 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22 .\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
23 .\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24 .\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
25 .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27 .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28 .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
29 .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .Dd November 6, 2010
33 .Dt STANDARDS 7
34 .Os
35 .Sh NAME
36 .Nm standards
37 .Nd standards supported by DragonFly
38 .Sh SYNOPSIS
39 .Fd "#define _XOPEN_SOURCE 600"
40 .Pp
41 .In sys/cdefs.h
42 .Sh DESCRIPTION
43 A number of
44 .Dq feature test macros ,
45 namely
46 .Dv _POSIX_C_SOURCE
47 and
48 .Dv _XOPEN_SOURCE ,
49 can be used by applications to indicate desired sets of features (beyond
50 those specified by the C standard) in the programming environment supplied by
51 .Dx .
52 These macros determine which prototypes are exposed by header files and so on.
53 .Pp
54 If neither
55 .Dv _POSIX_C_SOURCE
56 and
57 .Dv _XOPEN_SOURCE
58 are set, the programming environment defaults to
59 .St -susv3 .
60 In addition, a number of
61 .Bx
62 specific prototypes, definitions etc.\& are made visible.
63 .Ss POSIX Standards (_POSIX_C_SOURCE)
64 The value of the
65 .Dv _POSIX_C_SOURCE
66 macro determines which
67 .Tn POSIX
68 standard the programming environment conforms to.
69 .Bl -tag -width ".Li 199009"
70 .It Li 1
71 Make definitions conforming to
72 .St -p1003.1-90
73 visible.
74 Implies
75 .St -isoC-90 .
76 .It Li 2
77 Additionally, make definitions conforming to
78 .St -p1003.2-92
79 visible.
80 .It Li 199009
81 Same as
82 .Li 1 .
83 .It Li 199209
84 Same as
85 .Li 2 .
86 .It Li 199309
87 Additionally, make definitions conforming to
88 .St -p1003.1b-93
89 visible.
90 .It Li 199506
91 Additionally, make definitions conforming to
92 .St -p1003.1c-95
93 visible.
94 .It Li 200112
95 Additionally, make definitions conforming to
96 .St -p1003.1-2001
97 visible.
98 Implies
99 .St -isoC-99 .
100 This is the default.
101 .It Li 200809
102 Additionally, make definitions conforming to
103 .St -p1003.1-2008
104 visible.
105 Implies
106 .St -isoC-99 .
107 .El
108 .Pp
109 Defining
110 .Dv _POSIX_C_SOURCE
111 to any value lower than
112 .Li 199009
113 (other than
114 .Li 1
115 or
116 .Li 2 )
117 makes it default to
118 .Li 198808
119 which makes definitions conforming to
120 .St -p1003.1-88
121 visible.
122 No C standard is implied in this case.
123 .Pp
124 Defining the obsolete
125 .Dv _POSIX_SOURCE
126 macro without defining
127 .Dv _POSIX_C_SOURCE
128 is equivalent to defining
129 .Dv _POSIX_C_SOURCE
130 to
131 .Li 198808 .
132 .Ss X/Open CAE Specifications (_XOPEN_SOURCE)
133 The value of the
134 .Dv _XOPEN_SOURCE
135 macro determines which X/Open CAE specification the programming
136 environment conforms to.
137 .Bl -tag -width ".Li 500"
138 .It Li 500
139 Make defintions conforming to the
140 .St -susv2
141 visible.
142 Implies defining
143 .Dv _POSIX_C_SOURCE
144 to
145 .Li 199506 .
146 .It Li 600
147 Make definitions conforming to the
148 .St -susv3
149 visible.
150 Implies defining
151 .Dv _POSIX_C_SOURCE
152 to
153 .Li 200112 .
154 This is the default.
155 .It Li 700
156 Make definitions conforming to
157 .St -p1003.1-2008
158 and to the corresponding XSI extensions visible.
159 .El
160 .Pp
161 If both CAE and POSIX conformance is required, only
162 .Dv _XOPEN_SOURCE
163 can be set.
164 .\".Ss Miscellaneous Macros
165 .\".Dv _ANSI_SOURCE
166 .\".Dv _C99_SOURCE
167 .\".Dv _DRAGONFLY_SOURCE
168 .\".Dv _NETBSD_SOURCE
169 .Sh HISTORY
170 A
171 .Nm
172 manual page first appeared in
173 .Dx 2.7 .