1 .\" Copyright (c) 1998 HD Associates, Inc.
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 .\" $FreeBSD: src/share/man/man9/posix4.9,v 1.5.2.5 2001/08/17 13:08:54 ru Exp $
26 .\" $DragonFly: src/share/man/man9/posix4.9,v 1.3 2004/03/11 12:28:57 hmp Exp $
32 .Nd "Posix P1003-1B extensions"
34 POSIX.1B adds real time extensions and some commonly used
35 Berkeley extensions to POSIX.1.
36 This section contains preliminary information about avoiding conflicts
37 and adding support for the required ability to specify the interface
40 March 28, 1998: _POSIX_PRIORITY_SCHEDULING works with these kernel
41 options in your configuration:
42 .Bd -literal -offset 0i
44 options "_KPOSIX_PRIORITY_SCHEDULING"
46 .Sh SPECIFYING THE VERSION
47 There are three manifest constants that set the version and programming interface
49 .Bd -literal -offset 0i
52 specifies the system for which the system is built. The default
53 is POSIX.1 and is 199009L. POSIX.1B is 199309L. This defines
54 the base features of the operating system.
55 .Bd -literal -offset 0i
58 is a macro from POSIX.1 that can
59 be defined to specify that only POSIX and ANSI functionality should occur
61 .Bd -literal -offset 0i
64 is a macro from POSIX.1B that can be defined to specify that only
65 POSIX and ANSI functionality from a specific POSIX version should occur
66 in the name space, i.e., if _POSIX_VERSION is 199309L (POSIX.1B) but
67 _POSIX_C_SOURCE is 199009L (POSIX.1) then only POSIX.1 features should
69 .Sh PROPERLY HIDING EXTENSIONS
70 The following test macros are set up in <sys/_posix.h>. They should
71 used by system header files to avoid the kind of tests you see in
72 <sys/_posix.h>. Source programs should not use these
75 implementation details and should test _POSIX_VERSION, _POSIX_SOURCE
77 These should not be used in the kernel though - the kernel should be
78 immune to the user land setting of _POSIX_VERSION. The P1003_1B option can
79 be used in the kernel to limit inclusion of new code, but make sure
80 things work properly when a POSIX.1B program is run on a kernel without
82 .Bd -literal -offset 0i
85 is a test macro that sorts out when extensions should be
86 visible. It is defined in <sys/_posix.h>.
88 In normal C program development
89 only _POSIX_VERSION is set, permitting
92 appear to the programs. However, when adding new functionality mandated
94 is important to satisfy the requirements added by the
95 new _POSIX_C_SOURCE macro. _P1003_1B_VISIBLE (not a standard feature test macro)
96 is defined in sys/unistd.h when the combination of _POSIX_VERSION,
97 _POSIX_SOURCE, and _POSIX_C_SOURCE indicate that the extensions are in scope.
98 .Bd -literal -offset 0i
99 _P1003_1B_VISIBLE_HISTORICALLY
101 is present to conditionalize POSIX.1B extensions that were historically
102 in the system. These are visible when _POSIX_SOURCE and _POSIX_C_SOURCE
103 are not set at all or when _POSIX_C_SOURCE enables POSIX.1B features.
104 The intent of this feature test is to permit hiding the new extensions
107 extensions show up to avoid breaking existing
108 programs without trying to use the "big hammer" of _POSIX_C_SOURCE.
110 Some recent additions to header files
111 are new enough that they should be changed to
112 be dependent on _P1003_1B_VISIBLE instead of _HISTORICALLY.
116 headers (e.g., mmap.h) now specified
117 in POSIX.1B can include <sys/_posix.h> and conditionalize
119 extensions on _P1003_1B_VISIBLE_HISTORICALLY.
120 .Sh NON STANDARD TEST MACROS
121 .Bd -literal -offset 0i
122 _P1003_1B_INCLUDE_MAYBES
124 when set before the inclusion of any other header file
125 requests that all header files that the POSIX.1B spec says a standard
126 header may include should be included. Normally no non-required
127 headers are included. Setting this pre-processor definition should
128 make any compliant program compile without issues of header file
130 .Bd -literal -offset 0i
133 is a config option to build in POSIX.1B support in the kernel.
138 section manual page appeared in