github.com/afumu/libc@v0.0.6/dirent/dirent_netbsd_amd64.go (about)

     1  // Code generated by 'ccgo dirent/gen.c -crt-import-path "" -export-defines "" -export-enums "" -export-externs X -export-fields F -export-structs "" -export-typedefs "" -header -hide _OSSwapInt16,_OSSwapInt32,_OSSwapInt64 -ignore-unsupported-alignment -o dirent/dirent_netbsd_amd64.go -pkgname dirent', DO NOT EDIT.
     2  
     3  package dirent
     4  
     5  import (
     6  	"math"
     7  	"reflect"
     8  	"sync/atomic"
     9  	"unsafe"
    10  )
    11  
    12  var _ = math.Pi
    13  var _ reflect.Kind
    14  var _ atomic.Value
    15  var _ unsafe.Pointer
    16  
    17  const (
    18  	BIG_ENDIAN                    = 4321                 // endian.h:101:1:
    19  	BYTE_ORDER                    = 1234                 // endian.h:103:1:
    20  	DIRBLKSIZ                     = 1024                 // dirent.h:55:1:
    21  	DTF_HIDEW                     = 0x0001               // dirent.h:79:1:
    22  	DTF_NODUP                     = 0x0002               // dirent.h:80:1:
    23  	DTF_REWIND                    = 0x0004               // dirent.h:81:1:
    24  	DT_BLK                        = 6                    // dirent.h:71:1:
    25  	DT_CHR                        = 2                    // dirent.h:69:1:
    26  	DT_DIR                        = 4                    // dirent.h:70:1:
    27  	DT_FIFO                       = 1                    // dirent.h:68:1:
    28  	DT_LNK                        = 10                   // dirent.h:73:1:
    29  	DT_REG                        = 8                    // dirent.h:72:1:
    30  	DT_SOCK                       = 12                   // dirent.h:74:1:
    31  	DT_UNKNOWN                    = 0                    // dirent.h:67:1:
    32  	DT_WHT                        = 14                   // dirent.h:75:1:
    33  	FD_SETSIZE                    = 256                  // fd_set.h:59:1:
    34  	INT16_MAX                     = 32767                // common_int_limits.h:53:1:
    35  	INT16_MIN                     = -32768               // common_int_limits.h:47:1:
    36  	INT32_MAX                     = 2147483647           // common_int_limits.h:54:1:
    37  	INT32_MIN                     = -2147483648          // common_int_limits.h:48:1:
    38  	INT64_MAX                     = 9223372036854775807  // common_int_limits.h:55:1:
    39  	INT64_MIN                     = -9223372036854775808 // common_int_limits.h:49:1:
    40  	INT8_MAX                      = 127                  // common_int_limits.h:52:1:
    41  	INT8_MIN                      = -128                 // common_int_limits.h:46:1:
    42  	INTMAX_MAX                    = 9223372036854775807  // common_int_limits.h:111:1:
    43  	INTMAX_MIN                    = -9223372036854775808 // common_int_limits.h:110:1:
    44  	INTPTR_MAX                    = 9223372036854775807  // common_int_limits.h:105:1:
    45  	INTPTR_MIN                    = -9223372036854775808 // common_int_limits.h:104:1:
    46  	INT_FAST16_MAX                = 2147483647           // common_int_limits.h:93:1:
    47  	INT_FAST16_MIN                = -2147483648          // common_int_limits.h:87:1:
    48  	INT_FAST32_MAX                = 2147483647           // common_int_limits.h:94:1:
    49  	INT_FAST32_MIN                = -2147483648          // common_int_limits.h:88:1:
    50  	INT_FAST64_MAX                = 9223372036854775807  // common_int_limits.h:95:1:
    51  	INT_FAST64_MIN                = -9223372036854775808 // common_int_limits.h:89:1:
    52  	INT_FAST8_MAX                 = 2147483647           // common_int_limits.h:92:1:
    53  	INT_FAST8_MIN                 = -2147483648          // common_int_limits.h:86:1:
    54  	INT_LEAST16_MAX               = 32767                // common_int_limits.h:73:1:
    55  	INT_LEAST16_MIN               = -32768               // common_int_limits.h:67:1:
    56  	INT_LEAST32_MAX               = 2147483647           // common_int_limits.h:74:1:
    57  	INT_LEAST32_MIN               = -2147483648          // common_int_limits.h:68:1:
    58  	INT_LEAST64_MAX               = 9223372036854775807  // common_int_limits.h:75:1:
    59  	INT_LEAST64_MIN               = -9223372036854775808 // common_int_limits.h:69:1:
    60  	INT_LEAST8_MAX                = 127                  // common_int_limits.h:72:1:
    61  	INT_LEAST8_MIN                = -128                 // common_int_limits.h:66:1:
    62  	LITTLE_ENDIAN                 = 1234                 // endian.h:100:1:
    63  	MAXNAMLEN                     = 511                  // dirent.h:56:1:
    64  	NBBY                          = 8                    // types.h:316:1:
    65  	NFDBITS                       = 32                   // fd_set.h:93:1:
    66  	NODEVMAJOR                    = -1                   // types.h:258:1:
    67  	PDP_ENDIAN                    = 3412                 // endian.h:102:1:
    68  	PTRDIFF_MAX                   = 9223372036854775807  // common_int_limits.h:121:1:
    69  	PTRDIFF_MIN                   = -9223372036854775808 // common_int_limits.h:120:1:
    70  	SIG_ATOMIC_MAX                = 2147483647           // common_int_limits.h:125:1:
    71  	SIG_ATOMIC_MIN                = -2147483648          // common_int_limits.h:124:1:
    72  	SIZE_MAX                      = 18446744073709551615 // common_int_limits.h:128:1:
    73  	UINT16_MAX                    = 65535                // common_int_limits.h:59:1:
    74  	UINT32_MAX                    = 4294967295           // common_int_limits.h:60:1:
    75  	UINT64_MAX                    = 18446744073709551615 // common_int_limits.h:61:1:
    76  	UINT8_MAX                     = 255                  // common_int_limits.h:58:1:
    77  	UINTMAX_MAX                   = 18446744073709551615 // common_int_limits.h:112:1:
    78  	UINTPTR_MAX                   = 18446744073709551615 // common_int_limits.h:106:1:
    79  	UINT_FAST16_MAX               = 4294967295           // common_int_limits.h:99:1:
    80  	UINT_FAST32_MAX               = 4294967295           // common_int_limits.h:100:1:
    81  	UINT_FAST64_MAX               = 18446744073709551615 // common_int_limits.h:101:1:
    82  	UINT_FAST8_MAX                = 4294967295           // common_int_limits.h:98:1:
    83  	UINT_LEAST16_MAX              = 65535                // common_int_limits.h:79:1:
    84  	UINT_LEAST32_MAX              = 4294967295           // common_int_limits.h:80:1:
    85  	UINT_LEAST64_MAX              = 18446744073709551615 // common_int_limits.h:81:1:
    86  	UINT_LEAST8_MAX               = 255                  // common_int_limits.h:78:1:
    87  	WCHAR_MAX                     = 0x7fffffff           // wchar_limits.h:41:1:
    88  	WCHAR_MIN                     = -2147483648          // wchar_limits.h:40:1:
    89  	WINT_MAX                      = 0x7fffffff           // wchar_limits.h:45:1:
    90  	WINT_MIN                      = -2147483648          // wchar_limits.h:44:1:
    91  	X_AMD64_BYTE_SWAP_H_          = 0                    // byte_swap.h:37:1:
    92  	X_AMD64_INT_CONST_H_          = 0                    // int_const.h:33:1:
    93  	X_AMD64_INT_LIMITS_H_         = 0                    // int_limits.h:33:1:
    94  	X_AMD64_INT_MWGWTYPES_H_      = 0                    // int_mwgwtypes.h:33:1:
    95  	X_AMD64_INT_TYPES_H_          = 0                    // int_types.h:35:1:
    96  	X_AMD64_WCHAR_LIMITS_H_       = 0                    // wchar_limits.h:33:1:
    97  	X_BIG_ENDIAN                  = 4321                 // endian.h:44:1:
    98  	X_BSD_INT16_T_                = 0                    // types.h:65:1:
    99  	X_BSD_INT32_T_                = 0                    // types.h:75:1:
   100  	X_BSD_INT64_T_                = 0                    // types.h:85:1:
   101  	X_BSD_INT8_T_                 = 0                    // types.h:55:1:
   102  	X_BSD_INTPTR_T_               = 0                    // stdint.h:80:1:
   103  	X_BSD_UINT16_T_               = 0                    // types.h:70:1:
   104  	X_BSD_UINT32_T_               = 0                    // types.h:80:1:
   105  	X_BSD_UINT64_T_               = 0                    // types.h:90:1:
   106  	X_BSD_UINT8_T_                = 0                    // types.h:60:1:
   107  	X_BSD_UINTPTR_T_              = 0                    // stdint.h:85:1:
   108  	X_BYTE_ORDER                  = 1234                 // endian_machdep.h:3:1:
   109  	X_DIRENT_H_                   = 0                    // dirent.h:35:1:
   110  	X_FILE_OFFSET_BITS            = 64                   // <builtin>:25:1:
   111  	X_LIB_PTHREAD_TYPES_H         = 0                    // pthread_types.h:33:1:
   112  	X_LITTLE_ENDIAN               = 1234                 // endian.h:43:1:
   113  	X_LP64                        = 1                    // <predefined>:268:1:
   114  	X_NETBSD_SOURCE               = 1                    // featuretest.h:70:1:
   115  	X_PDP_ENDIAN                  = 3412                 // endian.h:45:1:
   116  	X_PT_BARRIERATTR_DEAD         = 0xDEAD0808           // pthread_types.h:278:1:
   117  	X_PT_BARRIERATTR_MAGIC        = 0x88880808           // pthread_types.h:277:1:
   118  	X_PT_BARRIER_DEAD             = 0xDEAD0008           // pthread_types.h:270:1:
   119  	X_PT_BARRIER_MAGIC            = 0x88880008           // pthread_types.h:269:1:
   120  	X_PT_CONDATTR_DEAD            = 0xDEAD0006           // pthread_types.h:197:1:
   121  	X_PT_CONDATTR_MAGIC           = 0x66660006           // pthread_types.h:196:1:
   122  	X_PT_COND_DEAD                = 0xDEAD0005           // pthread_types.h:182:1:
   123  	X_PT_COND_MAGIC               = 0x55550005           // pthread_types.h:181:1:
   124  	X_PT_MUTEXATTR_DEAD           = 0xDEAD0004           // pthread_types.h:167:1:
   125  	X_PT_MUTEXATTR_MAGIC          = 0x44440004           // pthread_types.h:166:1:
   126  	X_PT_MUTEX_DEAD               = 0xDEAD0003           // pthread_types.h:139:1:
   127  	X_PT_MUTEX_MAGIC              = 0x33330003           // pthread_types.h:138:1:
   128  	X_PT_RWLOCKATTR_DEAD          = 0xDEAD0909           // pthread_types.h:253:1:
   129  	X_PT_RWLOCKATTR_MAGIC         = 0x99990909           // pthread_types.h:252:1:
   130  	X_PT_RWLOCK_DEAD              = 0xDEAD0009           // pthread_types.h:236:1:
   131  	X_PT_RWLOCK_MAGIC             = 0x99990009           // pthread_types.h:235:1:
   132  	X_PT_SPINLOCK_DEAD            = 0xDEAD0007           // pthread_types.h:213:1:
   133  	X_PT_SPINLOCK_MAGIC           = 0x77770007           // pthread_types.h:212:1:
   134  	X_PT_SPINLOCK_PSHARED         = 0x00000001           // pthread_types.h:214:1:
   135  	X_QUAD_HIGHWORD               = 1                    // endian.h:84:1:
   136  	X_QUAD_LOWWORD                = 0                    // endian.h:85:1:
   137  	X_SIZE_T                      = 0                    // types.h:279:1:
   138  	X_SYS_ANSI_H_                 = 0                    // ansi.h:33:1:
   139  	X_SYS_BSWAP_H_                = 0                    // bswap.h:6:1:
   140  	X_SYS_CDEFS_ELF_H_            = 0                    // cdefs_elf.h:31:1:
   141  	X_SYS_CDEFS_H_                = 0                    // cdefs.h:37:1:
   142  	X_SYS_COMMON_ANSI_H_          = 0                    // common_ansi.h:33:1:
   143  	X_SYS_COMMON_INT_LIMITS_H_    = 0                    // common_int_limits.h:33:1:
   144  	X_SYS_COMMON_INT_MWGWTYPES_H_ = 0                    // common_int_mwgwtypes.h:33:1:
   145  	X_SYS_COMMON_INT_TYPES_H_     = 0                    // common_int_types.h:33:1:
   146  	X_SYS_DIRENT_H_               = 0                    // dirent.h:35:1:
   147  	X_SYS_ENDIAN_H_               = 0                    // endian.h:35:1:
   148  	X_SYS_FD_SET_H_               = 0                    // fd_set.h:35:1:
   149  	X_SYS_NULL_H_                 = 0                    // null.h:9:1:
   150  	X_SYS_STDINT_H_               = 0                    // stdint.h:33:1:
   151  	X_SYS_TYPES_H_                = 0                    // types.h:40:1:
   152  	X_X86_64_BSWAP_H_             = 0                    // bswap.h:6:1:
   153  	X_X86_64_CDEFS_H_             = 0                    // cdefs.h:4:1:
   154  	X_X86_64_TYPES_H_             = 0                    // types.h:35:1:
   155  )
   156  
   157  type Ptrdiff_t = int64 /* <builtin>:3:26 */
   158  
   159  type Size_t = uint64 /* <builtin>:9:23 */
   160  
   161  type Wchar_t = int32 /* <builtin>:15:24 */
   162  
   163  type X__int128_t = struct {
   164  	Flo int64
   165  	Fhi int64
   166  } /* <builtin>:21:43 */ // must match modernc.org/mathutil.Int128
   167  type X__uint128_t = struct {
   168  	Flo uint64
   169  	Fhi uint64
   170  } /* <builtin>:22:44 */ // must match modernc.org/mathutil.Int128
   171  
   172  type X__builtin_va_list = uintptr /* <builtin>:46:14 */
   173  type X__float128 = float64        /* <builtin>:47:21 */
   174  
   175  // return true if value 'a' fits in type 't'
   176  
   177  //	$NetBSD: featuretest.h,v 1.10 2013/04/26 18:29:06 christos Exp $
   178  
   179  // Written by Klaus Klein <kleink@NetBSD.org>, February 2, 1998.
   180  // Public domain.
   181  //
   182  // NOTE: Do not protect this header against multiple inclusion.  Doing
   183  // so can have subtle side-effects due to header file inclusion order
   184  // and testing of e.g. _POSIX_SOURCE vs. _POSIX_C_SOURCE.  Instead,
   185  // protect each CPP macro that we want to supply.
   186  
   187  // Feature-test macros are defined by several standards, and allow an
   188  // application to specify what symbols they want the system headers to
   189  // expose, and hence what standard they want them to conform to.
   190  // There are two classes of feature-test macros.  The first class
   191  // specify complete standards, and if one of these is defined, header
   192  // files will try to conform to the relevant standard.  They are:
   193  //
   194  // ANSI macros:
   195  // _ANSI_SOURCE			ANSI C89
   196  //
   197  // POSIX macros:
   198  // _POSIX_SOURCE == 1		IEEE Std 1003.1 (version?)
   199  // _POSIX_C_SOURCE == 1		IEEE Std 1003.1-1990
   200  // _POSIX_C_SOURCE == 2		IEEE Std 1003.2-1992
   201  // _POSIX_C_SOURCE == 199309L	IEEE Std 1003.1b-1993
   202  // _POSIX_C_SOURCE == 199506L	ISO/IEC 9945-1:1996
   203  // _POSIX_C_SOURCE == 200112L	IEEE Std 1003.1-2001
   204  // _POSIX_C_SOURCE == 200809L   IEEE Std 1003.1-2008
   205  //
   206  // X/Open macros:
   207  // _XOPEN_SOURCE		System Interfaces and Headers, Issue 4, Ver 2
   208  // _XOPEN_SOURCE_EXTENDED == 1	XSH4.2 UNIX extensions
   209  // _XOPEN_SOURCE == 500		System Interfaces and Headers, Issue 5
   210  // _XOPEN_SOURCE == 520		Networking Services (XNS), Issue 5.2
   211  // _XOPEN_SOURCE == 600		IEEE Std 1003.1-2001, XSI option
   212  // _XOPEN_SOURCE == 700		IEEE Std 1003.1-2008, XSI option
   213  //
   214  // NetBSD macros:
   215  // _NETBSD_SOURCE == 1		Make all NetBSD features available.
   216  //
   217  // If more than one of these "major" feature-test macros is defined,
   218  // then the set of facilities provided (and namespace used) is the
   219  // union of that specified by the relevant standards, and in case of
   220  // conflict, the earlier standard in the above list has precedence (so
   221  // if both _POSIX_C_SOURCE and _NETBSD_SOURCE are defined, the version
   222  // of rename() that's used is the POSIX one).  If none of the "major"
   223  // feature-test macros is defined, _NETBSD_SOURCE is assumed.
   224  //
   225  // There are also "minor" feature-test macros, which enable extra
   226  // functionality in addition to some base standard.  They should be
   227  // defined along with one of the "major" macros.  The "minor" macros
   228  // are:
   229  //
   230  // _REENTRANT
   231  // _ISOC99_SOURCE
   232  // _ISOC11_SOURCE
   233  // _LARGEFILE_SOURCE		Large File Support
   234  //		<http://ftp.sas.com/standards/large.file/x_open.20Mar96.html>
   235  
   236  //	$NetBSD: int_types.h,v 1.7 2014/07/25 21:43:13 joerg Exp $
   237  
   238  // -
   239  // Copyright (c) 1990 The Regents of the University of California.
   240  // All rights reserved.
   241  //
   242  // Redistribution and use in source and binary forms, with or without
   243  // modification, are permitted provided that the following conditions
   244  // are met:
   245  // 1. Redistributions of source code must retain the above copyright
   246  //    notice, this list of conditions and the following disclaimer.
   247  // 2. Redistributions in binary form must reproduce the above copyright
   248  //    notice, this list of conditions and the following disclaimer in the
   249  //    documentation and/or other materials provided with the distribution.
   250  // 3. Neither the name of the University nor the names of its contributors
   251  //    may be used to endorse or promote products derived from this software
   252  //    without specific prior written permission.
   253  //
   254  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   255  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   256  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   257  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   258  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   259  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   260  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   261  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   262  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   263  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   264  // SUCH DAMAGE.
   265  //
   266  //	from: @(#)types.h	7.5 (Berkeley) 3/9/91
   267  
   268  //	$NetBSD: common_int_types.h,v 1.1 2014/07/25 21:43:13 joerg Exp $
   269  
   270  // -
   271  // Copyright (c) 2014 The NetBSD Foundation, Inc.
   272  // All rights reserved.
   273  //
   274  // This code is derived from software contributed to The NetBSD Foundation
   275  // by Joerg Sonnenberger.
   276  //
   277  // Redistribution and use in source and binary forms, with or without
   278  // modification, are permitted provided that the following conditions
   279  // are met:
   280  // 1. Redistributions of source code must retain the above copyright
   281  //    notice, this list of conditions and the following disclaimer.
   282  // 2. Redistributions in binary form must reproduce the above copyright
   283  //    notice, this list of conditions and the following disclaimer in the
   284  //    documentation and/or other materials provided with the distribution.
   285  //
   286  // THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
   287  // ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
   288  // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   289  // PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
   290  // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   291  // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   292  // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   293  // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   294  // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   295  // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   296  // POSSIBILITY OF SUCH DAMAGE.
   297  
   298  // 7.18.1 Integer types
   299  
   300  // 7.18.1.1 Exact-width integer types
   301  
   302  type X__int8_t = int8     /* common_int_types.h:45:27 */
   303  type X__uint8_t = uint8   /* common_int_types.h:46:27 */
   304  type X__int16_t = int16   /* common_int_types.h:47:27 */
   305  type X__uint16_t = uint16 /* common_int_types.h:48:27 */
   306  type X__int32_t = int32   /* common_int_types.h:49:27 */
   307  type X__uint32_t = uint32 /* common_int_types.h:50:27 */
   308  type X__int64_t = int64   /* common_int_types.h:51:27 */
   309  type X__uint64_t = uint64 /* common_int_types.h:52:27 */
   310  
   311  // 7.18.1.4 Integer types capable of holding object pointers
   312  
   313  type X__intptr_t = int64   /* common_int_types.h:58:27 */
   314  type X__uintptr_t = uint64 /* common_int_types.h:59:26 */
   315  
   316  type X__register_t = int64           /* types.h:68:19 */
   317  type X__cpu_simple_lock_nv_t = uint8 /* types.h:69:24 */
   318  
   319  // __cpu_simple_lock_t used to be a full word.
   320  
   321  // The amd64 does not have strict alignment requirements.
   322  
   323  //	$NetBSD: ansi.h,v 1.11 2019/05/07 03:49:26 kamil Exp $
   324  
   325  //	$NetBSD: common_ansi.h,v 1.1 2014/08/19 07:27:31 matt Exp $
   326  
   327  // -
   328  // Copyright (c) 2014 The NetBSD Foundation, Inc.
   329  // All rights reserved.
   330  //
   331  // This code is derived from software contributed to The NetBSD Foundation
   332  // by Matt Thomas of 3am Software Foundry.
   333  //
   334  // Redistribution and use in source and binary forms, with or without
   335  // modification, are permitted provided that the following conditions
   336  // are met:
   337  // 1. Redistributions of source code must retain the above copyright
   338  //    notice, this list of conditions and the following disclaimer.
   339  // 2. Redistributions in binary form must reproduce the above copyright
   340  //    notice, this list of conditions and the following disclaimer in the
   341  //    documentation and/or other materials provided with the distribution.
   342  //
   343  // THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
   344  // ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
   345  // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   346  // PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
   347  // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   348  // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   349  // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   350  // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   351  // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   352  // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   353  // POSSIBILITY OF SUCH DAMAGE.
   354  
   355  //	$NetBSD: cdefs.h,v 1.141 2019/02/21 21:34:05 christos Exp $
   356  
   357  // * Copyright (c) 1991, 1993
   358  //	The Regents of the University of California.  All rights reserved.
   359  //
   360  // This code is derived from software contributed to Berkeley by
   361  // Berkeley Software Design, Inc.
   362  //
   363  // Redistribution and use in source and binary forms, with or without
   364  // modification, are permitted provided that the following conditions
   365  // are met:
   366  // 1. Redistributions of source code must retain the above copyright
   367  //    notice, this list of conditions and the following disclaimer.
   368  // 2. Redistributions in binary form must reproduce the above copyright
   369  //    notice, this list of conditions and the following disclaimer in the
   370  //    documentation and/or other materials provided with the distribution.
   371  // 3. Neither the name of the University nor the names of its contributors
   372  //    may be used to endorse or promote products derived from this software
   373  //    without specific prior written permission.
   374  //
   375  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   376  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   377  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   378  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   379  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   380  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   381  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   382  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   383  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   384  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   385  // SUCH DAMAGE.
   386  //
   387  //	@(#)cdefs.h	8.8 (Berkeley) 1/9/95
   388  
   389  //	$NetBSD: int_types.h,v 1.7 2014/07/25 21:43:13 joerg Exp $
   390  
   391  // -
   392  // Copyright (c) 1990 The Regents of the University of California.
   393  // All rights reserved.
   394  //
   395  // Redistribution and use in source and binary forms, with or without
   396  // modification, are permitted provided that the following conditions
   397  // are met:
   398  // 1. Redistributions of source code must retain the above copyright
   399  //    notice, this list of conditions and the following disclaimer.
   400  // 2. Redistributions in binary form must reproduce the above copyright
   401  //    notice, this list of conditions and the following disclaimer in the
   402  //    documentation and/or other materials provided with the distribution.
   403  // 3. Neither the name of the University nor the names of its contributors
   404  //    may be used to endorse or promote products derived from this software
   405  //    without specific prior written permission.
   406  //
   407  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   408  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   409  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   410  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   411  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   412  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   413  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   414  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   415  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   416  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   417  // SUCH DAMAGE.
   418  //
   419  //	from: @(#)types.h	7.5 (Berkeley) 3/9/91
   420  
   421  // Types which are fundamental to the implementation and may appear in
   422  // more than one standard header are defined here.  Standard headers
   423  // then use:
   424  //	#ifdef	_BSD_SIZE_T_
   425  //	typedef	_BSD_SIZE_T_ size_t;
   426  //	#undef	_BSD_SIZE_T_
   427  //	#endif
   428  
   429  //	$NetBSD: int_types.h,v 1.7 2014/07/25 21:43:13 joerg Exp $
   430  
   431  // -
   432  // Copyright (c) 1990 The Regents of the University of California.
   433  // All rights reserved.
   434  //
   435  // Redistribution and use in source and binary forms, with or without
   436  // modification, are permitted provided that the following conditions
   437  // are met:
   438  // 1. Redistributions of source code must retain the above copyright
   439  //    notice, this list of conditions and the following disclaimer.
   440  // 2. Redistributions in binary form must reproduce the above copyright
   441  //    notice, this list of conditions and the following disclaimer in the
   442  //    documentation and/or other materials provided with the distribution.
   443  // 3. Neither the name of the University nor the names of its contributors
   444  //    may be used to endorse or promote products derived from this software
   445  //    without specific prior written permission.
   446  //
   447  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   448  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   449  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   450  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   451  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   452  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   453  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   454  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   455  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   456  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   457  // SUCH DAMAGE.
   458  //
   459  //	from: @(#)types.h	7.5 (Berkeley) 3/9/91
   460  
   461  //	$NetBSD: ansi.h,v 1.14 2011/07/17 20:54:54 joerg Exp $
   462  
   463  // -
   464  // Copyright (c) 2000, 2001, 2002 The NetBSD Foundation, Inc.
   465  // All rights reserved.
   466  //
   467  // This code is derived from software contributed to The NetBSD Foundation
   468  // by Jun-ichiro itojun Hagino and by Klaus Klein.
   469  //
   470  // Redistribution and use in source and binary forms, with or without
   471  // modification, are permitted provided that the following conditions
   472  // are met:
   473  // 1. Redistributions of source code must retain the above copyright
   474  //    notice, this list of conditions and the following disclaimer.
   475  // 2. Redistributions in binary form must reproduce the above copyright
   476  //    notice, this list of conditions and the following disclaimer in the
   477  //    documentation and/or other materials provided with the distribution.
   478  //
   479  // THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
   480  // ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
   481  // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   482  // PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
   483  // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   484  // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   485  // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   486  // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   487  // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   488  // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   489  // POSSIBILITY OF SUCH DAMAGE.
   490  
   491  //	$NetBSD: ansi.h,v 1.11 2019/05/07 03:49:26 kamil Exp $
   492  
   493  //	$NetBSD: common_ansi.h,v 1.1 2014/08/19 07:27:31 matt Exp $
   494  
   495  // -
   496  // Copyright (c) 2014 The NetBSD Foundation, Inc.
   497  // All rights reserved.
   498  //
   499  // This code is derived from software contributed to The NetBSD Foundation
   500  // by Matt Thomas of 3am Software Foundry.
   501  //
   502  // Redistribution and use in source and binary forms, with or without
   503  // modification, are permitted provided that the following conditions
   504  // are met:
   505  // 1. Redistributions of source code must retain the above copyright
   506  //    notice, this list of conditions and the following disclaimer.
   507  // 2. Redistributions in binary form must reproduce the above copyright
   508  //    notice, this list of conditions and the following disclaimer in the
   509  //    documentation and/or other materials provided with the distribution.
   510  //
   511  // THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
   512  // ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
   513  // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   514  // PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
   515  // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   516  // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   517  // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   518  // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   519  // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   520  // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   521  // POSSIBILITY OF SUCH DAMAGE.
   522  
   523  type X__caddr_t = uintptr        /* ansi.h:37:14 */ // core address
   524  type X__gid_t = X__uint32_t      /* ansi.h:38:20 */ // group id
   525  type X__in_addr_t = X__uint32_t  /* ansi.h:39:20 */ // IP(v4) address
   526  type X__in_port_t = X__uint16_t  /* ansi.h:40:20 */ // "Internet" port number
   527  type X__mode_t = X__uint32_t     /* ansi.h:41:20 */ // file permissions
   528  type X__off_t = X__int64_t       /* ansi.h:42:19 */ // file offset
   529  type X__pid_t = X__int32_t       /* ansi.h:43:19 */ // process id
   530  type X__sa_family_t = X__uint8_t /* ansi.h:44:19 */ // socket address family
   531  type X__socklen_t = uint32       /* ansi.h:45:22 */ // socket-related datum length
   532  type X__uid_t = X__uint32_t      /* ansi.h:46:20 */ // user id
   533  type X__fsblkcnt_t = X__uint64_t /* ansi.h:47:20 */ // fs block count (statvfs)
   534  type X__fsfilcnt_t = X__uint64_t /* ansi.h:48:20 */
   535  type X__wctrans_t = uintptr      /* ansi.h:51:32 */
   536  type X__wctype_t = uintptr       /* ansi.h:54:31 */
   537  
   538  // mbstate_t is an opaque object to keep conversion state, during multibyte
   539  // stream conversions.  The content must not be referenced by user programs.
   540  type X__mbstate_t = struct {
   541  	F__mbstateL  X__int64_t
   542  	F__ccgo_pad1 [120]byte
   543  } /* ansi.h:63:3 */
   544  
   545  type X__va_list = X__builtin_va_list /* ansi.h:72:27 */
   546  
   547  type Int8_t = X__int8_t /* types.h:54:18 */
   548  
   549  type Uint8_t = X__uint8_t /* types.h:59:19 */
   550  
   551  type Int16_t = X__int16_t /* types.h:64:19 */
   552  
   553  type Uint16_t = X__uint16_t /* types.h:69:20 */
   554  
   555  type Int32_t = X__int32_t /* types.h:74:19 */
   556  
   557  type Uint32_t = X__uint32_t /* types.h:79:20 */
   558  
   559  type Int64_t = X__int64_t /* types.h:84:19 */
   560  
   561  type Uint64_t = X__uint64_t /* types.h:89:20 */
   562  
   563  type U_int8_t = Uint8_t   /* types.h:93:18 */
   564  type U_int16_t = Uint16_t /* types.h:94:18 */
   565  type U_int32_t = Uint32_t /* types.h:95:18 */
   566  type U_int64_t = Uint64_t /* types.h:96:18 */
   567  
   568  //	$NetBSD: endian.h,v 1.1 2003/04/26 18:39:40 fvdl Exp $
   569  
   570  //	$NetBSD: endian.h,v 1.30 2016/02/27 21:37:35 christos Exp $
   571  
   572  // Copyright (c) 1987, 1991, 1993
   573  //	The Regents of the University of California.  All rights reserved.
   574  //
   575  // Redistribution and use in source and binary forms, with or without
   576  // modification, are permitted provided that the following conditions
   577  // are met:
   578  // 1. Redistributions of source code must retain the above copyright
   579  //    notice, this list of conditions and the following disclaimer.
   580  // 2. Redistributions in binary form must reproduce the above copyright
   581  //    notice, this list of conditions and the following disclaimer in the
   582  //    documentation and/or other materials provided with the distribution.
   583  // 3. Neither the name of the University nor the names of its contributors
   584  //    may be used to endorse or promote products derived from this software
   585  //    without specific prior written permission.
   586  //
   587  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   588  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   589  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   590  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   591  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   592  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   593  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   594  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   595  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   596  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   597  // SUCH DAMAGE.
   598  //
   599  //	@(#)endian.h	8.1 (Berkeley) 6/11/93
   600  
   601  //	$NetBSD: featuretest.h,v 1.10 2013/04/26 18:29:06 christos Exp $
   602  
   603  // Written by Klaus Klein <kleink@NetBSD.org>, February 2, 1998.
   604  // Public domain.
   605  //
   606  // NOTE: Do not protect this header against multiple inclusion.  Doing
   607  // so can have subtle side-effects due to header file inclusion order
   608  // and testing of e.g. _POSIX_SOURCE vs. _POSIX_C_SOURCE.  Instead,
   609  // protect each CPP macro that we want to supply.
   610  
   611  // Feature-test macros are defined by several standards, and allow an
   612  // application to specify what symbols they want the system headers to
   613  // expose, and hence what standard they want them to conform to.
   614  // There are two classes of feature-test macros.  The first class
   615  // specify complete standards, and if one of these is defined, header
   616  // files will try to conform to the relevant standard.  They are:
   617  //
   618  // ANSI macros:
   619  // _ANSI_SOURCE			ANSI C89
   620  //
   621  // POSIX macros:
   622  // _POSIX_SOURCE == 1		IEEE Std 1003.1 (version?)
   623  // _POSIX_C_SOURCE == 1		IEEE Std 1003.1-1990
   624  // _POSIX_C_SOURCE == 2		IEEE Std 1003.2-1992
   625  // _POSIX_C_SOURCE == 199309L	IEEE Std 1003.1b-1993
   626  // _POSIX_C_SOURCE == 199506L	ISO/IEC 9945-1:1996
   627  // _POSIX_C_SOURCE == 200112L	IEEE Std 1003.1-2001
   628  // _POSIX_C_SOURCE == 200809L   IEEE Std 1003.1-2008
   629  //
   630  // X/Open macros:
   631  // _XOPEN_SOURCE		System Interfaces and Headers, Issue 4, Ver 2
   632  // _XOPEN_SOURCE_EXTENDED == 1	XSH4.2 UNIX extensions
   633  // _XOPEN_SOURCE == 500		System Interfaces and Headers, Issue 5
   634  // _XOPEN_SOURCE == 520		Networking Services (XNS), Issue 5.2
   635  // _XOPEN_SOURCE == 600		IEEE Std 1003.1-2001, XSI option
   636  // _XOPEN_SOURCE == 700		IEEE Std 1003.1-2008, XSI option
   637  //
   638  // NetBSD macros:
   639  // _NETBSD_SOURCE == 1		Make all NetBSD features available.
   640  //
   641  // If more than one of these "major" feature-test macros is defined,
   642  // then the set of facilities provided (and namespace used) is the
   643  // union of that specified by the relevant standards, and in case of
   644  // conflict, the earlier standard in the above list has precedence (so
   645  // if both _POSIX_C_SOURCE and _NETBSD_SOURCE are defined, the version
   646  // of rename() that's used is the POSIX one).  If none of the "major"
   647  // feature-test macros is defined, _NETBSD_SOURCE is assumed.
   648  //
   649  // There are also "minor" feature-test macros, which enable extra
   650  // functionality in addition to some base standard.  They should be
   651  // defined along with one of the "major" macros.  The "minor" macros
   652  // are:
   653  //
   654  // _REENTRANT
   655  // _ISOC99_SOURCE
   656  // _ISOC11_SOURCE
   657  // _LARGEFILE_SOURCE		Large File Support
   658  //		<http://ftp.sas.com/standards/large.file/x_open.20Mar96.html>
   659  
   660  // Definitions for byte order, according to byte significance from low
   661  // address to high.
   662  
   663  // C-family endian-ness definitions
   664  
   665  //	$NetBSD: ansi.h,v 1.14 2011/07/17 20:54:54 joerg Exp $
   666  
   667  // -
   668  // Copyright (c) 2000, 2001, 2002 The NetBSD Foundation, Inc.
   669  // All rights reserved.
   670  //
   671  // This code is derived from software contributed to The NetBSD Foundation
   672  // by Jun-ichiro itojun Hagino and by Klaus Klein.
   673  //
   674  // Redistribution and use in source and binary forms, with or without
   675  // modification, are permitted provided that the following conditions
   676  // are met:
   677  // 1. Redistributions of source code must retain the above copyright
   678  //    notice, this list of conditions and the following disclaimer.
   679  // 2. Redistributions in binary form must reproduce the above copyright
   680  //    notice, this list of conditions and the following disclaimer in the
   681  //    documentation and/or other materials provided with the distribution.
   682  //
   683  // THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
   684  // ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
   685  // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   686  // PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
   687  // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   688  // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   689  // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   690  // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   691  // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   692  // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   693  // POSSIBILITY OF SUCH DAMAGE.
   694  
   695  //	$NetBSD: cdefs.h,v 1.141 2019/02/21 21:34:05 christos Exp $
   696  
   697  // * Copyright (c) 1991, 1993
   698  //	The Regents of the University of California.  All rights reserved.
   699  //
   700  // This code is derived from software contributed to Berkeley by
   701  // Berkeley Software Design, Inc.
   702  //
   703  // Redistribution and use in source and binary forms, with or without
   704  // modification, are permitted provided that the following conditions
   705  // are met:
   706  // 1. Redistributions of source code must retain the above copyright
   707  //    notice, this list of conditions and the following disclaimer.
   708  // 2. Redistributions in binary form must reproduce the above copyright
   709  //    notice, this list of conditions and the following disclaimer in the
   710  //    documentation and/or other materials provided with the distribution.
   711  // 3. Neither the name of the University nor the names of its contributors
   712  //    may be used to endorse or promote products derived from this software
   713  //    without specific prior written permission.
   714  //
   715  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   716  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   717  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   718  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   719  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   720  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   721  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   722  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   723  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   724  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   725  // SUCH DAMAGE.
   726  //
   727  //	@(#)cdefs.h	8.8 (Berkeley) 1/9/95
   728  
   729  //	$NetBSD: types.h,v 1.102 2018/11/06 16:26:44 maya Exp $
   730  
   731  // -
   732  // Copyright (c) 1982, 1986, 1991, 1993, 1994
   733  //	The Regents of the University of California.  All rights reserved.
   734  // (c) UNIX System Laboratories, Inc.
   735  // All or some portions of this file are derived from material licensed
   736  // to the University of California by American Telephone and Telegraph
   737  // Co. or Unix System Laboratories, Inc. and are reproduced herein with
   738  // the permission of UNIX System Laboratories, Inc.
   739  //
   740  // Redistribution and use in source and binary forms, with or without
   741  // modification, are permitted provided that the following conditions
   742  // are met:
   743  // 1. Redistributions of source code must retain the above copyright
   744  //    notice, this list of conditions and the following disclaimer.
   745  // 2. Redistributions in binary form must reproduce the above copyright
   746  //    notice, this list of conditions and the following disclaimer in the
   747  //    documentation and/or other materials provided with the distribution.
   748  // 3. Neither the name of the University nor the names of its contributors
   749  //    may be used to endorse or promote products derived from this software
   750  //    without specific prior written permission.
   751  //
   752  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   753  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   754  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   755  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   756  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   757  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   758  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   759  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   760  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   761  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   762  // SUCH DAMAGE.
   763  //
   764  //	@(#)types.h	8.4 (Berkeley) 1/21/94
   765  
   766  type In_addr_t = X__in_addr_t /* endian.h:58:21 */
   767  
   768  type In_port_t = X__in_port_t /* endian.h:63:21 */
   769  
   770  //      $NetBSD: bswap.h,v 1.19 2015/03/12 15:28:16 christos Exp $
   771  
   772  // Written by Manuel Bouyer. Public domain
   773  
   774  //	$NetBSD: stdint.h,v 1.8 2018/11/06 16:26:44 maya Exp $
   775  
   776  // -
   777  // Copyright (c) 2001, 2004 The NetBSD Foundation, Inc.
   778  // All rights reserved.
   779  //
   780  // This code is derived from software contributed to The NetBSD Foundation
   781  // by Klaus Klein.
   782  //
   783  // Redistribution and use in source and binary forms, with or without
   784  // modification, are permitted provided that the following conditions
   785  // are met:
   786  // 1. Redistributions of source code must retain the above copyright
   787  //    notice, this list of conditions and the following disclaimer.
   788  // 2. Redistributions in binary form must reproduce the above copyright
   789  //    notice, this list of conditions and the following disclaimer in the
   790  //    documentation and/or other materials provided with the distribution.
   791  //
   792  // THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
   793  // ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
   794  // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   795  // PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
   796  // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   797  // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   798  // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   799  // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   800  // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   801  // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   802  // POSSIBILITY OF SUCH DAMAGE.
   803  
   804  //	$NetBSD: cdefs.h,v 1.141 2019/02/21 21:34:05 christos Exp $
   805  
   806  // * Copyright (c) 1991, 1993
   807  //	The Regents of the University of California.  All rights reserved.
   808  //
   809  // This code is derived from software contributed to Berkeley by
   810  // Berkeley Software Design, Inc.
   811  //
   812  // Redistribution and use in source and binary forms, with or without
   813  // modification, are permitted provided that the following conditions
   814  // are met:
   815  // 1. Redistributions of source code must retain the above copyright
   816  //    notice, this list of conditions and the following disclaimer.
   817  // 2. Redistributions in binary form must reproduce the above copyright
   818  //    notice, this list of conditions and the following disclaimer in the
   819  //    documentation and/or other materials provided with the distribution.
   820  // 3. Neither the name of the University nor the names of its contributors
   821  //    may be used to endorse or promote products derived from this software
   822  //    without specific prior written permission.
   823  //
   824  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   825  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   826  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   827  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   828  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   829  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   830  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   831  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   832  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   833  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   834  // SUCH DAMAGE.
   835  //
   836  //	@(#)cdefs.h	8.8 (Berkeley) 1/9/95
   837  
   838  //	$NetBSD: int_types.h,v 1.7 2014/07/25 21:43:13 joerg Exp $
   839  
   840  // -
   841  // Copyright (c) 1990 The Regents of the University of California.
   842  // All rights reserved.
   843  //
   844  // Redistribution and use in source and binary forms, with or without
   845  // modification, are permitted provided that the following conditions
   846  // are met:
   847  // 1. Redistributions of source code must retain the above copyright
   848  //    notice, this list of conditions and the following disclaimer.
   849  // 2. Redistributions in binary form must reproduce the above copyright
   850  //    notice, this list of conditions and the following disclaimer in the
   851  //    documentation and/or other materials provided with the distribution.
   852  // 3. Neither the name of the University nor the names of its contributors
   853  //    may be used to endorse or promote products derived from this software
   854  //    without specific prior written permission.
   855  //
   856  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   857  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   858  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   859  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   860  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   861  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   862  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   863  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   864  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   865  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   866  // SUCH DAMAGE.
   867  //
   868  //	from: @(#)types.h	7.5 (Berkeley) 3/9/91
   869  
   870  type Intptr_t = X__intptr_t /* stdint.h:79:20 */
   871  
   872  type Uintptr_t = X__uintptr_t /* stdint.h:84:21 */
   873  
   874  //	$NetBSD: int_mwgwtypes.h,v 1.8 2014/07/25 21:43:13 joerg Exp $
   875  
   876  // -
   877  // Copyright (c) 2001 The NetBSD Foundation, Inc.
   878  // All rights reserved.
   879  //
   880  // This code is derived from software contributed to The NetBSD Foundation
   881  // by Klaus Klein.
   882  //
   883  // Redistribution and use in source and binary forms, with or without
   884  // modification, are permitted provided that the following conditions
   885  // are met:
   886  // 1. Redistributions of source code must retain the above copyright
   887  //    notice, this list of conditions and the following disclaimer.
   888  // 2. Redistributions in binary form must reproduce the above copyright
   889  //    notice, this list of conditions and the following disclaimer in the
   890  //    documentation and/or other materials provided with the distribution.
   891  //
   892  // THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
   893  // ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
   894  // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   895  // PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
   896  // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   897  // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   898  // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   899  // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   900  // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   901  // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   902  // POSSIBILITY OF SUCH DAMAGE.
   903  
   904  //	$NetBSD: common_int_mwgwtypes.h,v 1.1 2014/07/25 21:43:13 joerg Exp $
   905  
   906  // -
   907  // Copyright (c) 2014 The NetBSD Foundation, Inc.
   908  // All rights reserved.
   909  //
   910  // This code is derived from software contributed to The NetBSD Foundation
   911  // by Joerg Sonnenberger.
   912  //
   913  // Redistribution and use in source and binary forms, with or without
   914  // modification, are permitted provided that the following conditions
   915  // are met:
   916  // 1. Redistributions of source code must retain the above copyright
   917  //    notice, this list of conditions and the following disclaimer.
   918  // 2. Redistributions in binary form must reproduce the above copyright
   919  //    notice, this list of conditions and the following disclaimer in the
   920  //    documentation and/or other materials provided with the distribution.
   921  //
   922  // THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
   923  // ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
   924  // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   925  // PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
   926  // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   927  // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   928  // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   929  // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   930  // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   931  // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   932  // POSSIBILITY OF SUCH DAMAGE.
   933  
   934  // 7.18.1 Integer types
   935  
   936  // 7.18.1.2 Minimum-width integer types
   937  
   938  type Int_least8_t = int8     /* common_int_mwgwtypes.h:45:32 */
   939  type Uint_least8_t = uint8   /* common_int_mwgwtypes.h:46:32 */
   940  type Int_least16_t = int16   /* common_int_mwgwtypes.h:47:32 */
   941  type Uint_least16_t = uint16 /* common_int_mwgwtypes.h:48:32 */
   942  type Int_least32_t = int32   /* common_int_mwgwtypes.h:49:32 */
   943  type Uint_least32_t = uint32 /* common_int_mwgwtypes.h:50:32 */
   944  type Int_least64_t = int64   /* common_int_mwgwtypes.h:51:32 */
   945  type Uint_least64_t = uint64 /* common_int_mwgwtypes.h:52:32 */
   946  
   947  // 7.18.1.3 Fastest minimum-width integer types
   948  type Int_fast8_t = int32    /* common_int_mwgwtypes.h:55:32 */
   949  type Uint_fast8_t = uint32  /* common_int_mwgwtypes.h:56:32 */
   950  type Int_fast16_t = int32   /* common_int_mwgwtypes.h:57:32 */
   951  type Uint_fast16_t = uint32 /* common_int_mwgwtypes.h:58:32 */
   952  type Int_fast32_t = int32   /* common_int_mwgwtypes.h:59:32 */
   953  type Uint_fast32_t = uint32 /* common_int_mwgwtypes.h:60:32 */
   954  type Int_fast64_t = int64   /* common_int_mwgwtypes.h:61:32 */
   955  type Uint_fast64_t = uint64 /* common_int_mwgwtypes.h:62:32 */
   956  
   957  // 7.18.1.5 Greatest-width integer types
   958  
   959  type Intmax_t = int64   /* common_int_mwgwtypes.h:66:33 */
   960  type Uintmax_t = uint64 /* common_int_mwgwtypes.h:67:32 */
   961  
   962  type U_char = uint8   /* types.h:101:23 */
   963  type U_short = uint16 /* types.h:102:24 */
   964  type U_int = uint32   /* types.h:103:22 */
   965  type U_long = uint64  /* types.h:104:23 */
   966  
   967  type Unchar = uint8  /* types.h:106:23 */ // Sys V compatibility
   968  type Ushort = uint16 /* types.h:107:24 */ // Sys V compatibility
   969  type Uint = uint32   /* types.h:108:22 */ // Sys V compatibility
   970  type Ulong = uint64  /* types.h:109:23 */ // Sys V compatibility
   971  
   972  type U_quad_t = Uint64_t /* types.h:112:18 */ // quads
   973  type Quad_t = Int64_t    /* types.h:113:18 */
   974  type Qaddr_t = uintptr   /* types.h:114:16 */
   975  
   976  // The types longlong_t and u_longlong_t exist for use with the
   977  // Sun-derived XDR routines involving these types, and their usage
   978  // in other contexts is discouraged.  Further note that these types
   979  // may not be equivalent to "long long" and "unsigned long long",
   980  // they are only guaranteed to be signed and unsigned 64-bit types
   981  // respectively.  Portable programs that need 64-bit types should use
   982  // the C99 types int64_t and uint64_t instead.
   983  
   984  type Longlong_t = Int64_t    /* types.h:126:18 */ // for XDR
   985  type U_longlong_t = Uint64_t /* types.h:127:18 */ // for XDR
   986  
   987  type Blkcnt_t = Int64_t  /* types.h:129:18 */ // fs block count
   988  type Blksize_t = Int32_t /* types.h:130:18 */ // fs optimal block size
   989  
   990  type Fsblkcnt_t = X__fsblkcnt_t /* types.h:133:22 */ // fs block count (statvfs)
   991  
   992  type Fsfilcnt_t = X__fsfilcnt_t /* types.h:138:22 */ // fs file count
   993  
   994  // We don't and shouldn't use caddr_t in the kernel anymore
   995  type Caddr_t = X__caddr_t /* types.h:145:19 */ // core address
   996  
   997  type Daddr_t = Int64_t /* types.h:154:18 */ // disk address
   998  
   999  type Dev_t = Uint64_t   /* types.h:157:18 */ // device number
  1000  type Fixpt_t = Uint32_t /* types.h:158:18 */ // fixed point number
  1001  
  1002  type Gid_t = X__gid_t /* types.h:161:18 */ // group id
  1003  
  1004  type Id_t = Uint32_t  /* types.h:165:18 */ // group id, process id or user id
  1005  type Ino_t = Uint64_t /* types.h:166:18 */ // inode number
  1006  type Key_t = int64    /* types.h:167:15 */ // IPC key (for Sys V IPC)
  1007  
  1008  type Mode_t = X__mode_t /* types.h:170:18 */ // permissions
  1009  
  1010  type Nlink_t = Uint32_t /* types.h:174:18 */ // link count
  1011  
  1012  type Off_t = X__off_t /* types.h:177:18 */ // file offset
  1013  
  1014  type Pid_t = X__pid_t  /* types.h:182:18 */ // process id
  1015  type Lwpid_t = Int32_t /* types.h:185:18 */ // LWP id
  1016  type Rlim_t = Uint64_t /* types.h:186:18 */ // resource limit
  1017  type Segsz_t = Int32_t /* types.h:187:18 */ // segment size
  1018  type Swblk_t = Int32_t /* types.h:188:18 */ // swap offset
  1019  
  1020  type Uid_t = X__uid_t /* types.h:191:18 */ // user id
  1021  
  1022  type Mqd_t = int32 /* types.h:195:14 */
  1023  
  1024  type Cpuid_t = uint64 /* types.h:197:23 */
  1025  
  1026  type Psetid_t = int32 /* types.h:199:14 */
  1027  
  1028  type X__cpu_simple_lock_t = X__cpu_simple_lock_nv_t /* types.h:201:41 */
  1029  
  1030  // Major, minor numbers, dev_t's.
  1031  type X__devmajor_t = Int32_t /* types.h:255:17 */
  1032  type X__devminor_t = Int32_t /* types.h:255:31 */
  1033  
  1034  type Clock_t = uint32 /* types.h:268:24 */
  1035  
  1036  type Ssize_t = int64 /* types.h:284:24 */
  1037  
  1038  type Time_t = X__int64_t /* types.h:289:23 */
  1039  
  1040  type Clockid_t = int32 /* types.h:294:26 */
  1041  
  1042  type Timer_t = int32 /* types.h:299:24 */
  1043  
  1044  type Suseconds_t = int32 /* types.h:304:27 */
  1045  
  1046  type Useconds_t = uint32 /* types.h:309:26 */
  1047  
  1048  //	$NetBSD: fd_set.h,v 1.7 2018/06/24 12:05:40 kamil Exp $
  1049  
  1050  // -
  1051  // Copyright (c) 1992, 1993
  1052  //	The Regents of the University of California.  All rights reserved.
  1053  //
  1054  // Redistribution and use in source and binary forms, with or without
  1055  // modification, are permitted provided that the following conditions
  1056  // are met:
  1057  // 1. Redistributions of source code must retain the above copyright
  1058  //    notice, this list of conditions and the following disclaimer.
  1059  // 2. Redistributions in binary form must reproduce the above copyright
  1060  //    notice, this list of conditions and the following disclaimer in the
  1061  //    documentation and/or other materials provided with the distribution.
  1062  // 3. Neither the name of the University nor the names of its contributors
  1063  //    may be used to endorse or promote products derived from this software
  1064  //    without specific prior written permission.
  1065  //
  1066  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1067  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1068  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1069  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1070  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1071  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1072  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1073  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1074  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1075  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1076  // SUCH DAMAGE.
  1077  //
  1078  //	from: @(#)types.h	8.4 (Berkeley) 1/21/94
  1079  
  1080  //	$NetBSD: cdefs.h,v 1.141 2019/02/21 21:34:05 christos Exp $
  1081  
  1082  // * Copyright (c) 1991, 1993
  1083  //	The Regents of the University of California.  All rights reserved.
  1084  //
  1085  // This code is derived from software contributed to Berkeley by
  1086  // Berkeley Software Design, Inc.
  1087  //
  1088  // Redistribution and use in source and binary forms, with or without
  1089  // modification, are permitted provided that the following conditions
  1090  // are met:
  1091  // 1. Redistributions of source code must retain the above copyright
  1092  //    notice, this list of conditions and the following disclaimer.
  1093  // 2. Redistributions in binary form must reproduce the above copyright
  1094  //    notice, this list of conditions and the following disclaimer in the
  1095  //    documentation and/or other materials provided with the distribution.
  1096  // 3. Neither the name of the University nor the names of its contributors
  1097  //    may be used to endorse or promote products derived from this software
  1098  //    without specific prior written permission.
  1099  //
  1100  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1101  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1102  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1103  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1104  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1105  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1106  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1107  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1108  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1109  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1110  // SUCH DAMAGE.
  1111  //
  1112  //	@(#)cdefs.h	8.8 (Berkeley) 1/9/95
  1113  
  1114  //	$NetBSD: featuretest.h,v 1.10 2013/04/26 18:29:06 christos Exp $
  1115  
  1116  // Written by Klaus Klein <kleink@NetBSD.org>, February 2, 1998.
  1117  // Public domain.
  1118  //
  1119  // NOTE: Do not protect this header against multiple inclusion.  Doing
  1120  // so can have subtle side-effects due to header file inclusion order
  1121  // and testing of e.g. _POSIX_SOURCE vs. _POSIX_C_SOURCE.  Instead,
  1122  // protect each CPP macro that we want to supply.
  1123  
  1124  // Feature-test macros are defined by several standards, and allow an
  1125  // application to specify what symbols they want the system headers to
  1126  // expose, and hence what standard they want them to conform to.
  1127  // There are two classes of feature-test macros.  The first class
  1128  // specify complete standards, and if one of these is defined, header
  1129  // files will try to conform to the relevant standard.  They are:
  1130  //
  1131  // ANSI macros:
  1132  // _ANSI_SOURCE			ANSI C89
  1133  //
  1134  // POSIX macros:
  1135  // _POSIX_SOURCE == 1		IEEE Std 1003.1 (version?)
  1136  // _POSIX_C_SOURCE == 1		IEEE Std 1003.1-1990
  1137  // _POSIX_C_SOURCE == 2		IEEE Std 1003.2-1992
  1138  // _POSIX_C_SOURCE == 199309L	IEEE Std 1003.1b-1993
  1139  // _POSIX_C_SOURCE == 199506L	ISO/IEC 9945-1:1996
  1140  // _POSIX_C_SOURCE == 200112L	IEEE Std 1003.1-2001
  1141  // _POSIX_C_SOURCE == 200809L   IEEE Std 1003.1-2008
  1142  //
  1143  // X/Open macros:
  1144  // _XOPEN_SOURCE		System Interfaces and Headers, Issue 4, Ver 2
  1145  // _XOPEN_SOURCE_EXTENDED == 1	XSH4.2 UNIX extensions
  1146  // _XOPEN_SOURCE == 500		System Interfaces and Headers, Issue 5
  1147  // _XOPEN_SOURCE == 520		Networking Services (XNS), Issue 5.2
  1148  // _XOPEN_SOURCE == 600		IEEE Std 1003.1-2001, XSI option
  1149  // _XOPEN_SOURCE == 700		IEEE Std 1003.1-2008, XSI option
  1150  //
  1151  // NetBSD macros:
  1152  // _NETBSD_SOURCE == 1		Make all NetBSD features available.
  1153  //
  1154  // If more than one of these "major" feature-test macros is defined,
  1155  // then the set of facilities provided (and namespace used) is the
  1156  // union of that specified by the relevant standards, and in case of
  1157  // conflict, the earlier standard in the above list has precedence (so
  1158  // if both _POSIX_C_SOURCE and _NETBSD_SOURCE are defined, the version
  1159  // of rename() that's used is the POSIX one).  If none of the "major"
  1160  // feature-test macros is defined, _NETBSD_SOURCE is assumed.
  1161  //
  1162  // There are also "minor" feature-test macros, which enable extra
  1163  // functionality in addition to some base standard.  They should be
  1164  // defined along with one of the "major" macros.  The "minor" macros
  1165  // are:
  1166  //
  1167  // _REENTRANT
  1168  // _ISOC99_SOURCE
  1169  // _ISOC11_SOURCE
  1170  // _LARGEFILE_SOURCE		Large File Support
  1171  //		<http://ftp.sas.com/standards/large.file/x_open.20Mar96.html>
  1172  
  1173  //	$NetBSD: int_types.h,v 1.7 2014/07/25 21:43:13 joerg Exp $
  1174  
  1175  // -
  1176  // Copyright (c) 1990 The Regents of the University of California.
  1177  // All rights reserved.
  1178  //
  1179  // Redistribution and use in source and binary forms, with or without
  1180  // modification, are permitted provided that the following conditions
  1181  // are met:
  1182  // 1. Redistributions of source code must retain the above copyright
  1183  //    notice, this list of conditions and the following disclaimer.
  1184  // 2. Redistributions in binary form must reproduce the above copyright
  1185  //    notice, this list of conditions and the following disclaimer in the
  1186  //    documentation and/or other materials provided with the distribution.
  1187  // 3. Neither the name of the University nor the names of its contributors
  1188  //    may be used to endorse or promote products derived from this software
  1189  //    without specific prior written permission.
  1190  //
  1191  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1192  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1193  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1194  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1195  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1196  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1197  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1198  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1199  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1200  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1201  // SUCH DAMAGE.
  1202  //
  1203  //	from: @(#)types.h	7.5 (Berkeley) 3/9/91
  1204  
  1205  // Implementation dependent defines, hidden from user space.
  1206  // POSIX does not specify them.
  1207  
  1208  type X__fd_mask = X__uint32_t /* fd_set.h:46:20 */
  1209  
  1210  // 32 = 2 ^ 5
  1211  
  1212  // Select uses bit fields of file descriptors.  These macros manipulate
  1213  // such bit fields.  Note: FD_SETSIZE may be defined by the user.
  1214  
  1215  type Fd_set1 = struct{ Ffds_bits [8]X__fd_mask } /* fd_set.h:66:9 */
  1216  
  1217  // 32 = 2 ^ 5
  1218  
  1219  // Select uses bit fields of file descriptors.  These macros manipulate
  1220  // such bit fields.  Note: FD_SETSIZE may be defined by the user.
  1221  
  1222  type Fd_set = Fd_set1 /* fd_set.h:68:3 */
  1223  
  1224  // Expose our internals if we are not required to hide them.
  1225  
  1226  type Kauth_cred_t = uintptr /* types.h:318:27 */
  1227  
  1228  type Pri_t = int32 /* types.h:320:13 */
  1229  
  1230  //	$NetBSD: pthread_types.h,v 1.23 2017/09/09 23:21:45 kamil Exp $
  1231  
  1232  // -
  1233  // Copyright (c) 2001, 2008 The NetBSD Foundation, Inc.
  1234  // All rights reserved.
  1235  //
  1236  // This code is derived from software contributed to The NetBSD Foundation
  1237  // by Nathan J. Williams.
  1238  //
  1239  // Redistribution and use in source and binary forms, with or without
  1240  // modification, are permitted provided that the following conditions
  1241  // are met:
  1242  // 1. Redistributions of source code must retain the above copyright
  1243  //    notice, this list of conditions and the following disclaimer.
  1244  // 2. Redistributions in binary form must reproduce the above copyright
  1245  //    notice, this list of conditions and the following disclaimer in the
  1246  //    documentation and/or other materials provided with the distribution.
  1247  //
  1248  // THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  1249  // ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  1250  // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  1251  // PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
  1252  // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  1253  // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  1254  // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  1255  // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  1256  // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  1257  // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  1258  // POSSIBILITY OF SUCH DAMAGE.
  1259  
  1260  // We use the "pthread_spin_t" name internally; "pthread_spinlock_t" is the
  1261  // POSIX spinlock object.
  1262  //
  1263  // C++ expects to be using PTHREAD_FOO_INITIALIZER as a member initializer.
  1264  // This does not work for volatile types.  Since C++ does not touch the guts
  1265  // of those types, we do not include volatile in the C++ definitions.
  1266  type Pthread_spin_t = X__cpu_simple_lock_t /* pthread_types.h:43:29 */
  1267  type X__pthread_spin_t = Pthread_spin_t    /* pthread_types.h:48:24 */
  1268  
  1269  // Copied from PTQ_HEAD in pthread_queue.h
  1270  
  1271  type Pthread_queue_struct_t = struct {
  1272  	Fptqh_first uintptr
  1273  	Fptqh_last  uintptr
  1274  } /* pthread_types.h:61:1 */
  1275  
  1276  type Pthread_queue_t = Pthread_queue_struct_t /* pthread_types.h:62:39 */
  1277  type X__pthread_attr_st = struct {
  1278  	Fpta_magic   uint32
  1279  	Fpta_flags   int32
  1280  	Fpta_private uintptr
  1281  } /* pthread_types.h:65:1 */
  1282  
  1283  type X__pthread_mutex_st = struct {
  1284  	Fptm_magic      uint32
  1285  	Fptm_errorcheck X__pthread_spin_t
  1286  	Fptm_pad1       [3]Uint8_t
  1287  	F__8            struct{ Fptm_ceiling uint8 }
  1288  	Fptm_pad2       [3]Uint8_t
  1289  	F__ccgo_pad1    [4]byte
  1290  	Fptm_owner      Pthread_t
  1291  	Fptm_waiters    uintptr
  1292  	Fptm_recursed   uint32
  1293  	F__ccgo_pad2    [4]byte
  1294  	Fptm_spare2     uintptr
  1295  } /* pthread_types.h:66:1 */
  1296  
  1297  type X__pthread_mutexattr_st = struct {
  1298  	Fptma_magic   uint32
  1299  	F__ccgo_pad1  [4]byte
  1300  	Fptma_private uintptr
  1301  } /* pthread_types.h:67:1 */
  1302  
  1303  type X__pthread_cond_st = struct {
  1304  	Fptc_magic   uint32
  1305  	Fptc_lock    X__pthread_spin_t
  1306  	F__ccgo_pad1 [3]byte
  1307  	Fptc_waiters Pthread_queue_t
  1308  	Fptc_mutex   uintptr
  1309  	Fptc_private uintptr
  1310  } /* pthread_types.h:68:1 */
  1311  
  1312  type X__pthread_condattr_st = struct {
  1313  	Fptca_magic   uint32
  1314  	F__ccgo_pad1  [4]byte
  1315  	Fptca_private uintptr
  1316  } /* pthread_types.h:69:1 */
  1317  
  1318  type X__pthread_rwlock_st = struct {
  1319  	Fptr_magic     uint32
  1320  	Fptr_interlock X__pthread_spin_t
  1321  	F__ccgo_pad1   [3]byte
  1322  	Fptr_rblocked  Pthread_queue_t
  1323  	Fptr_wblocked  Pthread_queue_t
  1324  	Fptr_nreaders  uint32
  1325  	F__ccgo_pad2   [4]byte
  1326  	Fptr_owner     Pthread_t
  1327  	Fptr_private   uintptr
  1328  } /* pthread_types.h:71:1 */
  1329  
  1330  type X__pthread_rwlockattr_st = struct {
  1331  	Fptra_magic   uint32
  1332  	F__ccgo_pad1  [4]byte
  1333  	Fptra_private uintptr
  1334  } /* pthread_types.h:72:1 */
  1335  
  1336  type X__pthread_barrier_st = struct {
  1337  	Fptb_magic      uint32
  1338  	Fptb_lock       Pthread_spin_t
  1339  	F__ccgo_pad1    [3]byte
  1340  	Fptb_waiters    Pthread_queue_t
  1341  	Fptb_initcount  uint32
  1342  	Fptb_curcount   uint32
  1343  	Fptb_generation uint32
  1344  	F__ccgo_pad2    [4]byte
  1345  	Fptb_private    uintptr
  1346  } /* pthread_types.h:73:1 */
  1347  
  1348  type X__pthread_barrierattr_st = struct {
  1349  	Fptba_magic   uint32
  1350  	F__ccgo_pad1  [4]byte
  1351  	Fptba_private uintptr
  1352  } /* pthread_types.h:74:1 */
  1353  
  1354  type Pthread_t = uintptr                           /* pthread_types.h:76:29 */
  1355  type Pthread_attr_t = X__pthread_attr_st           /* pthread_types.h:77:34 */
  1356  type Pthread_mutex_t = X__pthread_mutex_st         /* pthread_types.h:78:35 */
  1357  type Pthread_mutexattr_t = X__pthread_mutexattr_st /* pthread_types.h:79:39 */
  1358  type Pthread_cond_t = X__pthread_cond_st           /* pthread_types.h:80:34 */
  1359  type Pthread_condattr_t = X__pthread_condattr_st   /* pthread_types.h:81:38 */
  1360  type X__pthread_once_st = struct {
  1361  	Fpto_mutex   Pthread_mutex_t
  1362  	Fpto_done    int32
  1363  	F__ccgo_pad1 [4]byte
  1364  } /* pthread_types.h:82:9 */
  1365  
  1366  type Pthread_once_t = X__pthread_once_st /* pthread_types.h:82:34 */
  1367  type X__pthread_spinlock_st = struct {
  1368  	Fpts_magic   uint32
  1369  	Fpts_spin    X__pthread_spin_t
  1370  	F__ccgo_pad1 [3]byte
  1371  	Fpts_flags   int32
  1372  } /* pthread_types.h:83:9 */
  1373  
  1374  type Pthread_spinlock_t = X__pthread_spinlock_st       /* pthread_types.h:83:38 */
  1375  type Pthread_rwlock_t = X__pthread_rwlock_st           /* pthread_types.h:84:36 */
  1376  type Pthread_rwlockattr_t = X__pthread_rwlockattr_st   /* pthread_types.h:85:40 */
  1377  type Pthread_barrier_t = X__pthread_barrier_st         /* pthread_types.h:86:37 */
  1378  type Pthread_barrierattr_t = X__pthread_barrierattr_st /* pthread_types.h:87:41 */
  1379  type Pthread_key_t = int32                             /* pthread_types.h:88:13 */
  1380  
  1381  // The kernel defines the format of directory entries returned by
  1382  // the getdents(2) system call.
  1383  //	$NetBSD: dirent.h,v 1.30 2016/01/22 23:31:30 dholland Exp $
  1384  
  1385  // -
  1386  // Copyright (c) 1989, 1993
  1387  //	The Regents of the University of California.  All rights reserved.
  1388  //
  1389  // Redistribution and use in source and binary forms, with or without
  1390  // modification, are permitted provided that the following conditions
  1391  // are met:
  1392  // 1. Redistributions of source code must retain the above copyright
  1393  //    notice, this list of conditions and the following disclaimer.
  1394  // 2. Redistributions in binary form must reproduce the above copyright
  1395  //    notice, this list of conditions and the following disclaimer in the
  1396  //    documentation and/or other materials provided with the distribution.
  1397  // 3. Neither the name of the University nor the names of its contributors
  1398  //    may be used to endorse or promote products derived from this software
  1399  //    without specific prior written permission.
  1400  //
  1401  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1402  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1403  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1404  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1405  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1406  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1407  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1408  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1409  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1410  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1411  // SUCH DAMAGE.
  1412  //
  1413  //	@(#)dirent.h	8.3 (Berkeley) 8/10/94
  1414  
  1415  //	$NetBSD: cdefs.h,v 1.141 2019/02/21 21:34:05 christos Exp $
  1416  
  1417  // * Copyright (c) 1991, 1993
  1418  //	The Regents of the University of California.  All rights reserved.
  1419  //
  1420  // This code is derived from software contributed to Berkeley by
  1421  // Berkeley Software Design, Inc.
  1422  //
  1423  // Redistribution and use in source and binary forms, with or without
  1424  // modification, are permitted provided that the following conditions
  1425  // are met:
  1426  // 1. Redistributions of source code must retain the above copyright
  1427  //    notice, this list of conditions and the following disclaimer.
  1428  // 2. Redistributions in binary form must reproduce the above copyright
  1429  //    notice, this list of conditions and the following disclaimer in the
  1430  //    documentation and/or other materials provided with the distribution.
  1431  // 3. Neither the name of the University nor the names of its contributors
  1432  //    may be used to endorse or promote products derived from this software
  1433  //    without specific prior written permission.
  1434  //
  1435  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1436  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1437  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1438  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1439  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1440  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1441  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1442  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1443  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1444  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1445  // SUCH DAMAGE.
  1446  //
  1447  //	@(#)cdefs.h	8.8 (Berkeley) 1/9/95
  1448  
  1449  //	$NetBSD: featuretest.h,v 1.10 2013/04/26 18:29:06 christos Exp $
  1450  
  1451  // Written by Klaus Klein <kleink@NetBSD.org>, February 2, 1998.
  1452  // Public domain.
  1453  //
  1454  // NOTE: Do not protect this header against multiple inclusion.  Doing
  1455  // so can have subtle side-effects due to header file inclusion order
  1456  // and testing of e.g. _POSIX_SOURCE vs. _POSIX_C_SOURCE.  Instead,
  1457  // protect each CPP macro that we want to supply.
  1458  
  1459  // Feature-test macros are defined by several standards, and allow an
  1460  // application to specify what symbols they want the system headers to
  1461  // expose, and hence what standard they want them to conform to.
  1462  // There are two classes of feature-test macros.  The first class
  1463  // specify complete standards, and if one of these is defined, header
  1464  // files will try to conform to the relevant standard.  They are:
  1465  //
  1466  // ANSI macros:
  1467  // _ANSI_SOURCE			ANSI C89
  1468  //
  1469  // POSIX macros:
  1470  // _POSIX_SOURCE == 1		IEEE Std 1003.1 (version?)
  1471  // _POSIX_C_SOURCE == 1		IEEE Std 1003.1-1990
  1472  // _POSIX_C_SOURCE == 2		IEEE Std 1003.2-1992
  1473  // _POSIX_C_SOURCE == 199309L	IEEE Std 1003.1b-1993
  1474  // _POSIX_C_SOURCE == 199506L	ISO/IEC 9945-1:1996
  1475  // _POSIX_C_SOURCE == 200112L	IEEE Std 1003.1-2001
  1476  // _POSIX_C_SOURCE == 200809L   IEEE Std 1003.1-2008
  1477  //
  1478  // X/Open macros:
  1479  // _XOPEN_SOURCE		System Interfaces and Headers, Issue 4, Ver 2
  1480  // _XOPEN_SOURCE_EXTENDED == 1	XSH4.2 UNIX extensions
  1481  // _XOPEN_SOURCE == 500		System Interfaces and Headers, Issue 5
  1482  // _XOPEN_SOURCE == 520		Networking Services (XNS), Issue 5.2
  1483  // _XOPEN_SOURCE == 600		IEEE Std 1003.1-2001, XSI option
  1484  // _XOPEN_SOURCE == 700		IEEE Std 1003.1-2008, XSI option
  1485  //
  1486  // NetBSD macros:
  1487  // _NETBSD_SOURCE == 1		Make all NetBSD features available.
  1488  //
  1489  // If more than one of these "major" feature-test macros is defined,
  1490  // then the set of facilities provided (and namespace used) is the
  1491  // union of that specified by the relevant standards, and in case of
  1492  // conflict, the earlier standard in the above list has precedence (so
  1493  // if both _POSIX_C_SOURCE and _NETBSD_SOURCE are defined, the version
  1494  // of rename() that's used is the POSIX one).  If none of the "major"
  1495  // feature-test macros is defined, _NETBSD_SOURCE is assumed.
  1496  //
  1497  // There are also "minor" feature-test macros, which enable extra
  1498  // functionality in addition to some base standard.  They should be
  1499  // defined along with one of the "major" macros.  The "minor" macros
  1500  // are:
  1501  //
  1502  // _REENTRANT
  1503  // _ISOC99_SOURCE
  1504  // _ISOC11_SOURCE
  1505  // _LARGEFILE_SOURCE		Large File Support
  1506  //		<http://ftp.sas.com/standards/large.file/x_open.20Mar96.html>
  1507  
  1508  // The dirent structure defines the format of directory entries returned by
  1509  // the getdents(2) system call.
  1510  //
  1511  // A directory entry has a struct dirent at the front of it, containing its
  1512  // inode number, the length of the entry, and the length of the name
  1513  // contained in the entry.  These are followed by the name padded to
  1514  // _DIRENT_ALIGN() byte boundary with null bytes.  All names are guaranteed
  1515  // NUL terminated.  The maximum length of a name in a directory is MAXNAMLEN.
  1516  type Dirent = struct {
  1517  	Fd_fileno    Ino_t
  1518  	Fd_reclen    Uint16_t
  1519  	Fd_namlen    Uint16_t
  1520  	Fd_type      Uint8_t
  1521  	Fd_name      [512]int8
  1522  	F__ccgo_pad1 [3]byte
  1523  } /* dirent.h:50:1 */
  1524  
  1525  // File types
  1526  
  1527  // Caution: the following macros are used by the ufs/ffs code on ffs's
  1528  // struct direct as well as the exposed struct dirent. The two
  1529  // structures are not the same, so it's important (until ufs is fixed,
  1530  // XXX) that the macro definitions remain type-polymorphic.
  1531  
  1532  // The _DIRENT_ALIGN macro returns the alignment of struct dirent.
  1533  // struct direct and struct dirent12 used 4 byte alignment but
  1534  // struct dirent uses 8.
  1535  // The _DIRENT_NAMEOFF macro returns the offset of the d_name field in
  1536  // struct dirent
  1537  // The _DIRENT_RECLEN macro gives the minimum record length which will hold
  1538  // a name of size "namlen".  This requires the amount of space in struct dirent
  1539  // without the d_name field, plus enough space for the name with a terminating
  1540  // null byte (namlen+1), rounded up to a the appropriate byte boundary.
  1541  // The _DIRENT_SIZE macro returns the minimum record length required for
  1542  // name name stored in the current record.
  1543  // The _DIRENT_NEXT macro advances to the next dirent record.
  1544  // The _DIRENT_MINSIZE returns the size of an empty (invalid) record.
  1545  
  1546  // Convert between stat structure types and directory types.
  1547  
  1548  type X_dirdesc = struct {
  1549  	Fdd_fd       int32
  1550  	F__ccgo_pad1 [4]byte
  1551  	Fdd_loc      int64
  1552  	Fdd_size     int64
  1553  	Fdd_buf      uintptr
  1554  	Fdd_len      int32
  1555  	F__ccgo_pad2 [4]byte
  1556  	Fdd_seek     X__off_t
  1557  	Fdd_internal uintptr
  1558  	Fdd_flags    int32
  1559  	F__ccgo_pad3 [4]byte
  1560  	Fdd_lock     uintptr
  1561  } /* dirent.h:50:9 */
  1562  
  1563  // File types
  1564  
  1565  // Caution: the following macros are used by the ufs/ffs code on ffs's
  1566  // struct direct as well as the exposed struct dirent. The two
  1567  // structures are not the same, so it's important (until ufs is fixed,
  1568  // XXX) that the macro definitions remain type-polymorphic.
  1569  
  1570  // The _DIRENT_ALIGN macro returns the alignment of struct dirent.
  1571  // struct direct and struct dirent12 used 4 byte alignment but
  1572  // struct dirent uses 8.
  1573  // The _DIRENT_NAMEOFF macro returns the offset of the d_name field in
  1574  // struct dirent
  1575  // The _DIRENT_RECLEN macro gives the minimum record length which will hold
  1576  // a name of size "namlen".  This requires the amount of space in struct dirent
  1577  // without the d_name field, plus enough space for the name with a terminating
  1578  // null byte (namlen+1), rounded up to a the appropriate byte boundary.
  1579  // The _DIRENT_SIZE macro returns the minimum record length required for
  1580  // name name stored in the current record.
  1581  // The _DIRENT_NEXT macro advances to the next dirent record.
  1582  // The _DIRENT_MINSIZE returns the size of an empty (invalid) record.
  1583  
  1584  // Convert between stat structure types and directory types.
  1585  
  1586  type DIR = X_dirdesc /* dirent.h:50:25 */
  1587  
  1588  var _ int8 /* gen.c:2:13: */