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 43A number of 44.Dq feature test macros , 45namely 46.Dv _POSIX_C_SOURCE 47and 48.Dv _XOPEN_SOURCE , 49can be used by applications to indicate desired sets of features (beyond 50those specified by the C standard) in the programming environment supplied by 51.Dx . 52These macros determine which prototypes are exposed by header files and so on. 53.Pp 54If neither 55.Dv _POSIX_C_SOURCE 56and 57.Dv _XOPEN_SOURCE 58are set, the programming environment defaults to 59.St -susv3 . 60In addition, a number of 61.Bx 62specific prototypes, definitions etc.\& are made visible. 63.Ss POSIX Standards (_POSIX_C_SOURCE) 64The value of the 65.Dv _POSIX_C_SOURCE 66macro determines which 67.Tn POSIX 68standard the programming environment conforms to. 69.Bl -tag -width ".Li 199009" 70.It Li 1 71Make definitions conforming to 72.St -p1003.1-90 73visible. 74Implies 75.St -isoC-90 . 76.It Li 2 77Additionally, make definitions conforming to 78.St -p1003.2-92 79visible. 80.It Li 199009 81Same as 82.Li 1 . 83.It Li 199209 84Same as 85.Li 2 . 86.It Li 199309 87Additionally, make definitions conforming to 88.St -p1003.1b-93 89visible. 90.It Li 199506 91Additionally, make definitions conforming to 92.St -p1003.1c-95 93visible. 94.It Li 200112 95Additionally, make definitions conforming to 96.St -p1003.1-2001 97visible. 98Implies 99.St -isoC-99 . 100This is the default. 101.It Li 200809 102Additionally, make definitions conforming to 103.St -p1003.1-2008 104visible. 105Implies 106.St -isoC-99 . 107.El 108.Pp 109Defining 110.Dv _POSIX_C_SOURCE 111to any value lower than 112.Li 199009 113(other than 114.Li 1 115or 116.Li 2 ) 117makes it default to 118.Li 198808 119which makes definitions conforming to 120.St -p1003.1-88 121visible. 122No C standard is implied in this case. 123.Pp 124Defining the obsolete 125.Dv _POSIX_SOURCE 126macro without defining 127.Dv _POSIX_C_SOURCE 128is equivalent to defining 129.Dv _POSIX_C_SOURCE 130to 131.Li 198808 . 132.Ss X/Open CAE Specifications (_XOPEN_SOURCE) 133The value of the 134.Dv _XOPEN_SOURCE 135macro determines which X/Open CAE specification the programming 136environment conforms to. 137.Bl -tag -width ".Li 500" 138.It Li 500 139Make defintions conforming to the 140.St -susv2 141visible. 142Implies defining 143.Dv _POSIX_C_SOURCE 144to 145.Li 199506 . 146.It Li 600 147Make definitions conforming to the 148.St -susv3 149visible. 150Implies defining 151.Dv _POSIX_C_SOURCE 152to 153.Li 200112 . 154This is the default. 155.It Li 700 156Make definitions conforming to 157.St -p1003.1-2008 158and to the corresponding XSI extensions visible. 159.El 160.Pp 161If both CAE and POSIX conformance is required, only 162.Dv _XOPEN_SOURCE 163can 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 170A 171.Nm 172manual page first appeared in 173.Dx 2.7 . 174