Initial import from FreeBSD RELENG_4:
[games.git] / share / man / man9 / posix4.9
1 .\" Copyright (c) 1998 HD Associates, Inc.
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
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.
12 .\"
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
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD: src/share/man/man9/posix4.9,v 1.5.2.5 2001/08/17 13:08:54 ru Exp $
26 .Dd March 1, 1998
27 .Dt POSIX.1B 9
28 .Os
29 .Sh NAME
30 .Nm posix1b
31 .Nd "Posix P1003-1B extensions"
32 .Sh DESCRIPTION
33 POSIX.1B adds real time extensions and some commonly used
34 Berkeley extensions to POSIX.1.
35 This section contains preliminary information about avoiding conflicts
36 and adding support for the required ability to specify the interface
37 version.
38 .Sh STATUS
39 March 28, 1998: _POSIX_PRIORITY_SCHEDULING works with these kernel
40 options in your configuration:
41 .Bd -literal -offset 0i
42 options         "P1003_1B"
43 options         "_KPOSIX_PRIORITY_SCHEDULING"
44 .Ed
45 .Sh SPECIFYING THE VERSION
46 There are three manifest constants that set the version and programming interface
47 for POSIX.1B.
48 .Bd -literal -offset 0i
49 _POSIX_VERSION
50 .Ed
51 specifies the system for which the system is built.  The default
52 is POSIX.1 and is 199009L.  POSIX.1B is 199309L.  This defines
53 the base features of the operating system.
54 .Bd -literal -offset 0i
55 _POSIX_SOURCE
56 .Ed
57 is a macro from POSIX.1 that can
58 be defined to specify that only POSIX and ANSI functionality should occur
59 in the name space.
60 .Bd -literal -offset 0i
61 _POSIX_C_SOURCE
62 .Ed
63 is a macro from POSIX.1B that can be defined to specify that only
64 POSIX and ANSI functionality from a specific POSIX version should occur
65 in the name space, i.e., if _POSIX_VERSION is 199309L (POSIX.1B) but
66 _POSIX_C_SOURCE is 199009L (POSIX.1) then only POSIX.1 features should
67 appear.
68 .Sh PROPERLY HIDING EXTENSIONS
69 The following test macros are set up in <sys/_posix.h>.  They should
70 used by system header files to avoid the kind of tests you see in
71 <sys/_posix.h>.  Source programs should not use these
72 .Fx
73 specific
74 implementation details and should test _POSIX_VERSION, _POSIX_SOURCE
75 and _POSIX_C_SOURCE.
76 These should not be used in the kernel though - the kernel should be
77 immune to the user land setting of _POSIX_VERSION.  The P1003_1B option can
78 be used in the kernel to limit inclusion of new code, but make sure
79 things work properly when a POSIX.1B program is run on a kernel without
80 the P1003_1B option.
81 .Bd -literal -offset 0i
82 _P1003_1B_VISIBLE
83 .Ed
84 is a test macro that sorts out when extensions should be
85 visible.  It is defined in <sys/_posix.h>.
86 .Pp
87 In normal C program development
88 only _POSIX_VERSION is set, permitting
89 .Bx
90 extensions to
91 appear to the programs.  However, when adding new functionality mandated
92 by POSIX.1B, it
93 is important to satisfy the requirements added by the
94 new _POSIX_C_SOURCE macro.  _P1003_1B_VISIBLE (not a standard feature test macro)
95 is defined in sys/unistd.h when the combination of _POSIX_VERSION,
96 _POSIX_SOURCE, and _POSIX_C_SOURCE indicate that the extensions are in scope.
97 .Bd -literal -offset 0i
98 _P1003_1B_VISIBLE_HISTORICALLY
99 .Ed
100 is present to conditionalize POSIX.1B extensions that were historically
101 in the system.  These are visible when _POSIX_SOURCE and _POSIX_C_SOURCE
102 are not set at all or when _POSIX_C_SOURCE enables POSIX.1B features.
103 The intent of this feature test is to permit hiding the new extensions
104 while still letting
105 .Bx
106 extensions show up to avoid breaking existing
107 programs without trying to use the "big hammer" of _POSIX_C_SOURCE.
108 .Pp
109 Some recent additions to header files
110 are new enough that they should be changed to
111 be dependent on _P1003_1B_VISIBLE instead of _HISTORICALLY.
112 .Pp
113 Traditional
114 .Bx
115 headers (e.g., mmap.h) now specified
116 in POSIX.1B can include <sys/_posix.h> and conditionalize
117 .Bx
118 extensions on _P1003_1B_VISIBLE_HISTORICALLY.
119 .Sh NON STANDARD TEST MACROS
120 .Bd -literal -offset 0i
121 _P1003_1B_INCLUDE_MAYBES
122 .Ed
123 when set before the inclusion of any other header file
124 requests that all header files that the POSIX.1B spec says a standard
125 header may include should be included.  Normally no non-required
126 headers are included.  Setting this pre-processor definition should
127 make any compliant program compile without issues of header file
128 inclusion.
129 .Bd -literal -offset 0i
130 P1003_1B
131 .Ed
132 is a config option to build in POSIX.1B support in the kernel.
133 .\" .Sh SEE ALSO
134 .Sh HISTORY
135 The
136 .Nm
137 section manual page appeared in
138 .Fx 3.0 .