]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/sys/_posix.h
Add a __section(x) macro as well. Use this in linker_set.h. ie:
[FreeBSD/FreeBSD.git] / sys / sys / _posix.h
1 #ifndef _SYS__POSIX_H_
2 #define _SYS__POSIX_H_
3
4 /*-
5  * Copyright (c) 1998 HD Associates, Inc.
6  * All rights reserved.
7  * contact: dufault@hda.com
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in the
16  *    documentation and/or other materials provided with the distribution.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28  * SUCH DAMAGE.
29  *
30  * $FreeBSD$
31  */
32
33 /*
34  * This is a stand alone header file to set up for feature specification
35  * defined to take place before the inclusion of any standard header.
36  * It should only handle pre-processor defines.
37  *
38  * See section B.2.7 of 1003.1b-1993 
39  *
40  */
41
42 #ifdef _KERNEL
43
44 #if !defined(KLD_MODULE)
45 #include "opt_posix.h"
46 #endif
47
48 /* Only kern_mib.c uses _POSIX_VERSION.  Introduce a kernel
49  * one to avoid other pieces of the kernel getting dependant
50  * on that.
51  * XXX Complain if you think this dumb.
52  */
53
54 /* Make P1003 structures visible for the kernel if
55  * the P1003_1B option is in effect.
56  */
57 #ifdef P1003_1B
58 #define _P1003_1B_VISIBLE
59 #ifndef _KPOSIX_VERSION
60 #define _KPOSIX_VERSION         199309L
61 #endif
62 #endif
63
64 #ifndef _KPOSIX_VERSION
65 #define _KPOSIX_VERSION         199009L
66 #endif
67
68 #define _P1003_1B_VISIBLE_HISTORICALLY
69
70 #else
71
72 /* Test for visibility of P1003.1B features:
73  * If _POSIX_SOURCE and POSIX_C_SOURCE are completely undefined
74  * they show up.
75  *
76  * If they specify a version including P1003.1B then they show up.
77  *
78  * (Two macros are added to permit hiding new extensions while 
79  * keeping historic BSD features - that is not done now)
80  *
81  */
82
83 #if (!defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE)) || \
84  (_POSIX_VERSION  >= 199309L && defined(_POSIX_C_SOURCE) && \
85   _POSIX_C_SOURCE >= 199309L)
86 #define _P1003_1B_VISIBLE
87 #define _P1003_1B_VISIBLE_HISTORICALLY
88 #endif
89
90 #endif /* _KERNEL */
91 #endif /* _SYS__POSIX_H_ */