Home | History | Annotate | Download | only in sys
      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 (at) 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  *	$Id: _posix.h,v 1.1.1.1 2006/05/30 06:13:04 hhzhou Exp $
     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(ACTUALLY_LKM_NOT_KERNEL) && !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 /* Default to existing user space version.
     73  */
     74 #ifndef _POSIX_VERSION
     75 #define	_POSIX_VERSION		199009L
     76 #endif
     77 
     78 /* Test for visibility of P1003.1B features:
     79  * If _POSIX_SOURCE and POSIX_C_SOURCE are completely undefined
     80  * they show up.
     81  *
     82  * If they specify a version including P1003.1B then they show up.
     83  *
     84  * (Two macros are added to permit hiding new extensions while
     85  * keeping historic BSD features - that is not done now)
     86  *
     87  */
     88 
     89 #if (!defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE)) || \
     90  (_POSIX_VERSION  >= 199309L && defined(_POSIX_C_SOURCE) && \
     91   _POSIX_C_SOURCE >= 199309L)
     92 #define _P1003_1B_VISIBLE
     93 #define _P1003_1B_VISIBLE_HISTORICALLY
     94 #endif
     95 
     96 #endif /* not KERNEL */
     97 #endif /* _SYS__POSIX_H_ */
     98