STANDARDS(7)

NAME
standards - standards supported by DragonFly

SYNOPSIS
#define _XOPEN_SOURCE 600

#include <sys/cdefs.h>

DESCRIPTION
A number of “feature test macros”, namely _POSIX_C_SOURCE and _XOPEN_SOURCE, can be used by applications to indicate desired sets of features (beyond those specified by the C standard) in the programming environment supplied by DragonFly. These macros determine which prototypes are exposed by header files and so on.

If neither _POSIX_C_SOURCE and _XOPEN_SOURCE are set, the programming environment defaults to susv3. In addition, a number of BSD specific prototypes, definitions etc. are made visible.

  POSIX Standards (_POSIX_C_SOURCE)
The value of the _POSIX_C_SOURCE macro determines which POSIX standard the programming environment conforms to.

1   Make definitions conforming to p1003.1-90 visible. Implies isoC-90.

2   Additionally, make definitions conforming to p1003.2-92 visible.

199009
    Same as 1.

199209
    Same as 2.

199309
    Additionally, make definitions conforming to p1003.1b-93 visible.

199506
    Additionally, make definitions conforming to p1003.1c-95 visible.

200112
    Additionally, make definitions conforming to p1003.1-2001 visible. Implies isoC-99. This is the default.

200809
    Additionally, make definitions conforming to p1003.1-2008 visible. Implies isoC-99.

Defining _POSIX_C_SOURCE to any value lower than 199009 (other than 1 or 2) makes it default to 198808 which makes definitions conforming to p1003.1-88 visible. No C standard is implied in this case.

Defining the obsolete _POSIX_SOURCE macro without defining _POSIX_C_SOURCE is equivalent to defining _POSIX_C_SOURCE to 198808.

  X/Open CAE Specifications (_XOPEN_SOURCE)
The value of the _XOPEN_SOURCE macro determines which X/Open CAE specification the programming environment conforms to.

500 Make definitions conforming to the susv2 visible. Implies defining _POSIX_C_SOURCE to 199506.

600 Make definitions conforming to the susv3 visible. Implies defining _POSIX_C_SOURCE to 200112. This is the default.

700 Make definitions conforming to p1003.1-2008 and to the corresponding XSI extensions visible.

If both CAE and POSIX conformance is required, only _XOPEN_SOURCE can be set.

SEE ALSO

http://pubs.opengroup.org/onlinepubs/9699919799/
    p1003.1-2008

http://pubs.opengroup.org/onlinepubs/009695399/
    p1003.1-2004

http://pubs.opengroup.org/onlinepubs/7908799/
    susv2

http://pubs.opengroup.org/onlinepubs/9695969499/toc.pdf
    xsh4.2

HISTORY
A standards manual page first appeared in DragonFly 2.7.