fcntl_openbsd_amd64.go (38646B)
1 // Code generated by 'ccgo fcntl/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 fcntl/fcntl_openbsd_amd64.go -pkgname fcntl', DO NOT EDIT. 2 3 package fcntl 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 AT_EACCESS = 0x01 // fcntl.h:200:1: 19 AT_FDCWD = -100 // fcntl.h:198:1: 20 AT_REMOVEDIR = 0x08 // fcntl.h:203:1: 21 AT_SYMLINK_FOLLOW = 0x04 // fcntl.h:202:1: 22 AT_SYMLINK_NOFOLLOW = 0x02 // fcntl.h:201:1: 23 BIG_ENDIAN = 4321 // endian.h:45:1: 24 BYTE_ORDER = 1234 // endian.h:47:1: 25 FAPPEND = 8 // fcntl.h:130:1: 26 FASYNC = 64 // fcntl.h:131:1: 27 FD_CLOEXEC = 1 // fcntl.h:163:1: 28 FFSYNC = 128 // fcntl.h:132:1: 29 FNDELAY = 4 // fcntl.h:134:1: 30 FNONBLOCK = 4 // fcntl.h:133:1: 31 FREAD = 0x0001 // fcntl.h:76:1: 32 FWRITE = 0x0002 // fcntl.h:77:1: 33 F_DUPFD = 0 // fcntl.h:143:1: 34 F_DUPFD_CLOEXEC = 10 // fcntl.h:156:1: 35 F_GETFD = 1 // fcntl.h:144:1: 36 F_GETFL = 3 // fcntl.h:146:1: 37 F_GETLK = 7 // fcntl.h:152:1: 38 F_GETOWN = 5 // fcntl.h:149:1: 39 F_ISATTY = 11 // fcntl.h:159:1: 40 F_RDLCK = 1 // fcntl.h:166:1: 41 F_SETFD = 2 // fcntl.h:145:1: 42 F_SETFL = 4 // fcntl.h:147:1: 43 F_SETLK = 8 // fcntl.h:153:1: 44 F_SETLKW = 9 // fcntl.h:154:1: 45 F_SETOWN = 6 // fcntl.h:150:1: 46 F_UNLCK = 2 // fcntl.h:167:1: 47 F_WRLCK = 3 // fcntl.h:168:1: 48 LITTLE_ENDIAN = 1234 // endian.h:44:1: 49 LOCK_EX = 0x02 // fcntl.h:192:1: 50 LOCK_NB = 0x04 // fcntl.h:193:1: 51 LOCK_SH = 0x01 // fcntl.h:191:1: 52 LOCK_UN = 0x08 // fcntl.h:194:1: 53 O_ACCMODE = 0x0003 // fcntl.h:65:1: 54 O_APPEND = 0x0008 // fcntl.h:80:1: 55 O_ASYNC = 0x0040 // fcntl.h:84:1: 56 O_CLOEXEC = 0x10000 // fcntl.h:107:1: 57 O_CREAT = 0x0200 // fcntl.h:91:1: 58 O_DIRECTORY = 0x20000 // fcntl.h:108:1: 59 O_DSYNC = 128 // fcntl.h:100:1: 60 O_EXCL = 0x0800 // fcntl.h:93:1: 61 O_EXLOCK = 0x0020 // fcntl.h:83:1: 62 O_FSYNC = 0x0080 // fcntl.h:85:1: 63 O_NDELAY = 4 // fcntl.h:135:1: 64 O_NOCTTY = 0x8000 // fcntl.h:104:1: 65 O_NOFOLLOW = 0x0100 // fcntl.h:86:1: 66 O_NONBLOCK = 0x0004 // fcntl.h:79:1: 67 O_RDONLY = 0x0000 // fcntl.h:62:1: 68 O_RDWR = 0x0002 // fcntl.h:64:1: 69 O_RSYNC = 128 // fcntl.h:101:1: 70 O_SHLOCK = 0x0010 // fcntl.h:82:1: 71 O_SYNC = 0x0080 // fcntl.h:89:1: 72 O_TRUNC = 0x0400 // fcntl.h:92:1: 73 O_WRONLY = 0x0001 // fcntl.h:63:1: 74 PDP_ENDIAN = 3412 // endian.h:46:1: 75 X_BIG_ENDIAN = 4321 // _endian.h:43:1: 76 X_BYTE_ORDER = 1234 // endian.h:58:1: 77 X_CLOCKID_T_DEFINED_ = 0 // types.h:162:1: 78 X_CLOCK_T_DEFINED_ = 0 // types.h:157:1: 79 X_FILE_OFFSET_BITS = 64 // <builtin>:25:1: 80 X_INT16_T_DEFINED_ = 0 // types.h:84:1: 81 X_INT32_T_DEFINED_ = 0 // types.h:94:1: 82 X_INT64_T_DEFINED_ = 0 // types.h:104:1: 83 X_INT8_T_DEFINED_ = 0 // types.h:74:1: 84 X_LITTLE_ENDIAN = 1234 // _endian.h:42:1: 85 X_LP64 = 1 // <predefined>:1:1: 86 X_MACHINE_CDEFS_H_ = 0 // cdefs.h:9:1: 87 X_MACHINE_ENDIAN_H_ = 0 // endian.h:28:1: 88 X_MACHINE__TYPES_H_ = 0 // _types.h:36:1: 89 X_MAX_PAGE_SHIFT = 12 // _types.h:52:1: 90 X_OFF_T_DEFINED_ = 0 // types.h:192:1: 91 X_PDP_ENDIAN = 3412 // _endian.h:44:1: 92 X_PID_T_DEFINED_ = 0 // types.h:167:1: 93 X_QUAD_HIGHWORD = 1 // _endian.h:95:1: 94 X_QUAD_LOWWORD = 0 // _endian.h:96:1: 95 X_RET_PROTECTOR = 1 // <predefined>:2:1: 96 X_SIZE_T_DEFINED_ = 0 // types.h:172:1: 97 X_SSIZE_T_DEFINED_ = 0 // types.h:177:1: 98 X_STACKALIGNBYTES = 15 // _types.h:49:1: 99 X_SYS_CDEFS_H_ = 0 // cdefs.h:39:1: 100 X_SYS_ENDIAN_H_ = 0 // endian.h:38:1: 101 X_SYS_FCNTL_H_ = 0 // fcntl.h:41:1: 102 X_SYS_TYPES_H_ = 0 // types.h:41:1: 103 X_SYS__ENDIAN_H_ = 0 // _endian.h:34:1: 104 X_SYS__TYPES_H_ = 0 // _types.h:35:1: 105 X_TIMER_T_DEFINED_ = 0 // types.h:187:1: 106 X_TIME_T_DEFINED_ = 0 // types.h:182:1: 107 X_UINT16_T_DEFINED_ = 0 // types.h:89:1: 108 X_UINT32_T_DEFINED_ = 0 // types.h:99:1: 109 X_UINT64_T_DEFINED_ = 0 // types.h:109:1: 110 X_UINT8_T_DEFINED_ = 0 // types.h:79:1: 111 Unix = 1 // <predefined>:344:1: 112 ) 113 114 type Ptrdiff_t = int64 /* <builtin>:3:26 */ 115 116 type Size_t = uint64 /* <builtin>:9:23 */ 117 118 type Wchar_t = int32 /* <builtin>:15:24 */ 119 120 type X__int128_t = struct { 121 Flo int64 122 Fhi int64 123 } /* <builtin>:21:43 */ // must match modernc.org/mathutil.Int128 124 type X__uint128_t = struct { 125 Flo uint64 126 Fhi uint64 127 } /* <builtin>:22:44 */ // must match modernc.org/mathutil.Int128 128 129 type X__builtin_va_list = uintptr /* <builtin>:46:14 */ 130 type X__float128 = float64 /* <builtin>:47:21 */ 131 132 // $OpenBSD: fcntl.h,v 1.22 2019/01/21 18:09:21 anton Exp $ 133 // $NetBSD: fcntl.h,v 1.8 1995/03/26 20:24:12 jtc Exp $ 134 135 // - 136 // Copyright (c) 1983, 1990, 1993 137 // The Regents of the University of California. All rights reserved. 138 // (c) UNIX System Laboratories, Inc. 139 // All or some portions of this file are derived from material licensed 140 // to the University of California by American Telephone and Telegraph 141 // Co. or Unix System Laboratories, Inc. and are reproduced herein with 142 // the permission of UNIX System Laboratories, Inc. 143 // 144 // Redistribution and use in source and binary forms, with or without 145 // modification, are permitted provided that the following conditions 146 // are met: 147 // 1. Redistributions of source code must retain the above copyright 148 // notice, this list of conditions and the following disclaimer. 149 // 2. Redistributions in binary form must reproduce the above copyright 150 // notice, this list of conditions and the following disclaimer in the 151 // documentation and/or other materials provided with the distribution. 152 // 3. Neither the name of the University nor the names of its contributors 153 // may be used to endorse or promote products derived from this software 154 // without specific prior written permission. 155 // 156 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 157 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 158 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 159 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 160 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 161 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 162 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 163 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 164 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 165 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 166 // SUCH DAMAGE. 167 // 168 // @(#)fcntl.h 8.3 (Berkeley) 1/21/94 169 170 // This file includes the definitions for open and fcntl 171 // described by POSIX for <fcntl.h>; it also includes 172 // related kernel definitions. 173 174 // $OpenBSD: cdefs.h,v 1.43 2018/10/29 17:10:40 guenther Exp $ 175 // $NetBSD: cdefs.h,v 1.16 1996/04/03 20:46:39 christos Exp $ 176 177 // Copyright (c) 1991, 1993 178 // The Regents of the University of California. All rights reserved. 179 // 180 // This code is derived from software contributed to Berkeley by 181 // Berkeley Software Design, Inc. 182 // 183 // Redistribution and use in source and binary forms, with or without 184 // modification, are permitted provided that the following conditions 185 // are met: 186 // 1. Redistributions of source code must retain the above copyright 187 // notice, this list of conditions and the following disclaimer. 188 // 2. Redistributions in binary form must reproduce the above copyright 189 // notice, this list of conditions and the following disclaimer in the 190 // documentation and/or other materials provided with the distribution. 191 // 3. Neither the name of the University nor the names of its contributors 192 // may be used to endorse or promote products derived from this software 193 // without specific prior written permission. 194 // 195 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 196 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 197 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 198 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 199 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 200 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 201 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 202 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 203 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 204 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 205 // SUCH DAMAGE. 206 // 207 // @(#)cdefs.h 8.7 (Berkeley) 1/21/94 208 209 // $OpenBSD: cdefs.h,v 1.3 2013/03/28 17:30:45 martynas Exp $ 210 211 // Written by J.T. Conklin <jtc@wimsey.com> 01/17/95. 212 // Public domain. 213 214 // Macro to test if we're using a specific version of gcc or later. 215 216 // The __CONCAT macro is used to concatenate parts of symbol names, e.g. 217 // with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. 218 // The __CONCAT macro is a bit tricky -- make sure you don't put spaces 219 // in between its arguments. Do not use __CONCAT on double-quoted strings, 220 // such as those from the __STRING macro: to concatenate strings just put 221 // them next to each other. 222 223 // GCC1 and some versions of GCC2 declare dead (non-returning) and 224 // pure (no side effects) functions using "volatile" and "const"; 225 // unfortunately, these then cause warnings under "-ansi -pedantic". 226 // GCC >= 2.5 uses the __attribute__((attrs)) style. All of these 227 // work for GNU C++ (modulo a slight glitch in the C++ grammar in 228 // the distribution version of 2.5.5). 229 230 // __returns_twice makes the compiler not assume the function 231 // only returns once. This affects registerisation of variables: 232 // even local variables need to be in memory across such a call. 233 // Example: setjmp() 234 235 // __only_inline makes the compiler only use this function definition 236 // for inlining; references that can't be inlined will be left as 237 // external references instead of generating a local copy. The 238 // matching library should include a simple extern definition for 239 // the function to handle those references. c.f. ctype.h 240 241 // GNU C version 2.96 adds explicit branch prediction so that 242 // the CPU back-end can hint the processor and also so that 243 // code blocks can be reordered such that the predicted path 244 // sees a more linear flow, thus improving cache behavior, etc. 245 // 246 // The following two macros provide us with a way to utilize this 247 // compiler feature. Use __predict_true() if you expect the expression 248 // to evaluate to true, and __predict_false() if you expect the 249 // expression to evaluate to false. 250 // 251 // A few notes about usage: 252 // 253 // * Generally, __predict_false() error condition checks (unless 254 // you have some _strong_ reason to do otherwise, in which case 255 // document it), and/or __predict_true() `no-error' condition 256 // checks, assuming you want to optimize for the no-error case. 257 // 258 // * Other than that, if you don't know the likelihood of a test 259 // succeeding from empirical or other `hard' evidence, don't 260 // make predictions. 261 // 262 // * These are meant to be used in places that are run `a lot'. 263 // It is wasteful to make predictions in code that is run 264 // seldomly (e.g. at subsystem initialization time) as the 265 // basic block reordering that this affects can often generate 266 // larger code. 267 268 // Delete pseudo-keywords wherever they are not available or needed. 269 270 // The __packed macro indicates that a variable or structure members 271 // should have the smallest possible alignment, despite any host CPU 272 // alignment requirements. 273 // 274 // The __aligned(x) macro specifies the minimum alignment of a 275 // variable or structure. 276 // 277 // These macros together are useful for describing the layout and 278 // alignment of messages exchanged with hardware or other systems. 279 280 // "The nice thing about standards is that there are so many to choose from." 281 // There are a number of "feature test macros" specified by (different) 282 // standards that determine which interfaces and types the header files 283 // should expose. 284 // 285 // Because of inconsistencies in these macros, we define our own 286 // set in the private name space that end in _VISIBLE. These are 287 // always defined and so headers can test their values easily. 288 // Things can get tricky when multiple feature macros are defined. 289 // We try to take the union of all the features requested. 290 // 291 // The following macros are guaranteed to have a value after cdefs.h 292 // has been included: 293 // __POSIX_VISIBLE 294 // __XPG_VISIBLE 295 // __ISO_C_VISIBLE 296 // __BSD_VISIBLE 297 298 // X/Open Portability Guides and Single Unix Specifications. 299 // _XOPEN_SOURCE XPG3 300 // _XOPEN_SOURCE && _XOPEN_VERSION = 4 XPG4 301 // _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED = 1 XPG4v2 302 // _XOPEN_SOURCE == 500 XPG5 303 // _XOPEN_SOURCE == 520 XPG5v2 304 // _XOPEN_SOURCE == 600 POSIX 1003.1-2001 with XSI 305 // _XOPEN_SOURCE == 700 POSIX 1003.1-2008 with XSI 306 // 307 // The XPG spec implies a specific value for _POSIX_C_SOURCE. 308 309 // POSIX macros, these checks must follow the XOPEN ones above. 310 // 311 // _POSIX_SOURCE == 1 1003.1-1988 (superseded by _POSIX_C_SOURCE) 312 // _POSIX_C_SOURCE == 1 1003.1-1990 313 // _POSIX_C_SOURCE == 2 1003.2-1992 314 // _POSIX_C_SOURCE == 199309L 1003.1b-1993 315 // _POSIX_C_SOURCE == 199506L 1003.1c-1995, 1003.1i-1995, 316 // and the omnibus ISO/IEC 9945-1:1996 317 // _POSIX_C_SOURCE == 200112L 1003.1-2001 318 // _POSIX_C_SOURCE == 200809L 1003.1-2008 319 // 320 // The POSIX spec implies a specific value for __ISO_C_VISIBLE, though 321 // this may be overridden by the _ISOC99_SOURCE macro later. 322 323 // _ANSI_SOURCE means to expose ANSI C89 interfaces only. 324 // If the user defines it in addition to one of the POSIX or XOPEN 325 // macros, assume the POSIX/XOPEN macro(s) should take precedence. 326 327 // _ISOC99_SOURCE, _ISOC11_SOURCE, __STDC_VERSION__, and __cplusplus 328 // override any of the other macros since they are non-exclusive. 329 330 // Finally deal with BSD-specific interfaces that are not covered 331 // by any standards. We expose these when none of the POSIX or XPG 332 // macros is defined or if the user explicitly asks for them. 333 334 // Default values. 335 336 // $OpenBSD: types.h,v 1.49 2022/08/06 13:31:13 semarie Exp $ 337 // $NetBSD: types.h,v 1.29 1996/11/15 22:48:25 jtc Exp $ 338 339 // - 340 // Copyright (c) 1982, 1986, 1991, 1993 341 // The Regents of the University of California. All rights reserved. 342 // (c) UNIX System Laboratories, Inc. 343 // All or some portions of this file are derived from material licensed 344 // to the University of California by American Telephone and Telegraph 345 // Co. or Unix System Laboratories, Inc. and are reproduced herein with 346 // the permission of UNIX System Laboratories, Inc. 347 // 348 // Redistribution and use in source and binary forms, with or without 349 // modification, are permitted provided that the following conditions 350 // are met: 351 // 1. Redistributions of source code must retain the above copyright 352 // notice, this list of conditions and the following disclaimer. 353 // 2. Redistributions in binary form must reproduce the above copyright 354 // notice, this list of conditions and the following disclaimer in the 355 // documentation and/or other materials provided with the distribution. 356 // 3. Neither the name of the University nor the names of its contributors 357 // may be used to endorse or promote products derived from this software 358 // without specific prior written permission. 359 // 360 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 361 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 362 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 363 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 364 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 365 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 366 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 367 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 368 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 369 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 370 // SUCH DAMAGE. 371 // 372 // @(#)types.h 8.4 (Berkeley) 1/21/94 373 374 // $OpenBSD: cdefs.h,v 1.43 2018/10/29 17:10:40 guenther Exp $ 375 // $NetBSD: cdefs.h,v 1.16 1996/04/03 20:46:39 christos Exp $ 376 377 // Copyright (c) 1991, 1993 378 // The Regents of the University of California. All rights reserved. 379 // 380 // This code is derived from software contributed to Berkeley by 381 // Berkeley Software Design, Inc. 382 // 383 // Redistribution and use in source and binary forms, with or without 384 // modification, are permitted provided that the following conditions 385 // are met: 386 // 1. Redistributions of source code must retain the above copyright 387 // notice, this list of conditions and the following disclaimer. 388 // 2. Redistributions in binary form must reproduce the above copyright 389 // notice, this list of conditions and the following disclaimer in the 390 // documentation and/or other materials provided with the distribution. 391 // 3. Neither the name of the University nor the names of its contributors 392 // may be used to endorse or promote products derived from this software 393 // without specific prior written permission. 394 // 395 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 396 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 397 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 398 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 399 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 400 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 401 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 402 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 403 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 404 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 405 // SUCH DAMAGE. 406 // 407 // @(#)cdefs.h 8.7 (Berkeley) 1/21/94 408 409 // $OpenBSD: endian.h,v 1.25 2014/12/21 04:49:00 guenther Exp $ 410 411 // - 412 // Copyright (c) 1997 Niklas Hallqvist. All rights reserved. 413 // 414 // Redistribution and use in source and binary forms, with or without 415 // modification, are permitted provided that the following conditions 416 // are met: 417 // 1. Redistributions of source code must retain the above copyright 418 // notice, this list of conditions and the following disclaimer. 419 // 2. Redistributions in binary form must reproduce the above copyright 420 // notice, this list of conditions and the following disclaimer in the 421 // documentation and/or other materials provided with the distribution. 422 // 423 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 424 // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 425 // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 426 // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 427 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 428 // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 429 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 430 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 431 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 432 // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 433 434 // Public definitions for little- and big-endian systems. 435 // This file should be included as <endian.h> in userspace and as 436 // <sys/endian.h> in the kernel. 437 // 438 // System headers that need endian information but that can't or don't 439 // want to export the public names here should include <sys/_endian.h> 440 // and use the internal names: _BYTE_ORDER, _*_ENDIAN, etc. 441 442 // $OpenBSD: cdefs.h,v 1.43 2018/10/29 17:10:40 guenther Exp $ 443 // $NetBSD: cdefs.h,v 1.16 1996/04/03 20:46:39 christos Exp $ 444 445 // Copyright (c) 1991, 1993 446 // The Regents of the University of California. All rights reserved. 447 // 448 // This code is derived from software contributed to Berkeley by 449 // Berkeley Software Design, Inc. 450 // 451 // Redistribution and use in source and binary forms, with or without 452 // modification, are permitted provided that the following conditions 453 // are met: 454 // 1. Redistributions of source code must retain the above copyright 455 // notice, this list of conditions and the following disclaimer. 456 // 2. Redistributions in binary form must reproduce the above copyright 457 // notice, this list of conditions and the following disclaimer in the 458 // documentation and/or other materials provided with the distribution. 459 // 3. Neither the name of the University nor the names of its contributors 460 // may be used to endorse or promote products derived from this software 461 // without specific prior written permission. 462 // 463 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 464 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 465 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 466 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 467 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 468 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 469 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 470 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 471 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 472 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 473 // SUCH DAMAGE. 474 // 475 // @(#)cdefs.h 8.7 (Berkeley) 1/21/94 476 477 // $OpenBSD: _endian.h,v 1.8 2018/01/11 23:13:37 dlg Exp $ 478 479 // - 480 // Copyright (c) 1997 Niklas Hallqvist. All rights reserved. 481 // 482 // Redistribution and use in source and binary forms, with or without 483 // modification, are permitted provided that the following conditions 484 // are met: 485 // 1. Redistributions of source code must retain the above copyright 486 // notice, this list of conditions and the following disclaimer. 487 // 2. Redistributions in binary form must reproduce the above copyright 488 // notice, this list of conditions and the following disclaimer in the 489 // documentation and/or other materials provided with the distribution. 490 // 491 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 492 // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 493 // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 494 // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 495 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 496 // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 497 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 498 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 499 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 500 // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 501 502 // Internal endianness macros. This pulls in <machine/endian.h> to 503 // get the correct setting direction for the platform and sets internal 504 // ('__' prefix) macros appropriately. 505 506 // $OpenBSD: _types.h,v 1.10 2022/08/06 13:31:13 semarie Exp $ 507 508 // - 509 // Copyright (c) 1990, 1993 510 // The Regents of the University of California. All rights reserved. 511 // 512 // Redistribution and use in source and binary forms, with or without 513 // modification, are permitted provided that the following conditions 514 // are met: 515 // 1. Redistributions of source code must retain the above copyright 516 // notice, this list of conditions and the following disclaimer. 517 // 2. Redistributions in binary form must reproduce the above copyright 518 // notice, this list of conditions and the following disclaimer in the 519 // documentation and/or other materials provided with the distribution. 520 // 3. Neither the name of the University nor the names of its contributors 521 // may be used to endorse or promote products derived from this software 522 // without specific prior written permission. 523 // 524 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 525 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 526 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 527 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 528 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 529 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 530 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 531 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 532 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 533 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 534 // SUCH DAMAGE. 535 // 536 // @(#)types.h 8.3 (Berkeley) 1/5/94 537 538 // $OpenBSD: _types.h,v 1.17 2018/03/05 01:15:25 deraadt Exp $ 539 540 // - 541 // Copyright (c) 1990, 1993 542 // The Regents of the University of California. All rights reserved. 543 // 544 // Redistribution and use in source and binary forms, with or without 545 // modification, are permitted provided that the following conditions 546 // are met: 547 // 1. Redistributions of source code must retain the above copyright 548 // notice, this list of conditions and the following disclaimer. 549 // 2. Redistributions in binary form must reproduce the above copyright 550 // notice, this list of conditions and the following disclaimer in the 551 // documentation and/or other materials provided with the distribution. 552 // 3. Neither the name of the University nor the names of its contributors 553 // may be used to endorse or promote products derived from this software 554 // without specific prior written permission. 555 // 556 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 557 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 558 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 559 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 560 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 561 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 562 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 563 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 564 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 565 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 566 // SUCH DAMAGE. 567 // 568 // @(#)types.h 8.3 (Berkeley) 1/5/94 569 // @(#)ansi.h 8.2 (Berkeley) 1/4/94 570 571 // _ALIGN(p) rounds p (pointer or byte index) up to a correctly-aligned 572 // value for all data types (int, long, ...). The result is an 573 // unsigned long and must be cast to any desired pointer type. 574 // 575 // _ALIGNED_POINTER is a boolean macro that checks whether an address 576 // is valid to fetch data elements of type t from on this architecture. 577 // This does not reflect the optimal alignment, just the possibility 578 // (within reasonable limits). 579 580 // 7.18.1.1 Exact-width integer types 581 type X__int8_t = int8 /* _types.h:61:22 */ 582 type X__uint8_t = uint8 /* _types.h:62:24 */ 583 type X__int16_t = int16 /* _types.h:63:17 */ 584 type X__uint16_t = uint16 /* _types.h:64:25 */ 585 type X__int32_t = int32 /* _types.h:65:15 */ 586 type X__uint32_t = uint32 /* _types.h:66:23 */ 587 type X__int64_t = int64 /* _types.h:67:20 */ 588 type X__uint64_t = uint64 /* _types.h:68:28 */ 589 590 // 7.18.1.2 Minimum-width integer types 591 type X__int_least8_t = X__int8_t /* _types.h:71:19 */ 592 type X__uint_least8_t = X__uint8_t /* _types.h:72:20 */ 593 type X__int_least16_t = X__int16_t /* _types.h:73:20 */ 594 type X__uint_least16_t = X__uint16_t /* _types.h:74:21 */ 595 type X__int_least32_t = X__int32_t /* _types.h:75:20 */ 596 type X__uint_least32_t = X__uint32_t /* _types.h:76:21 */ 597 type X__int_least64_t = X__int64_t /* _types.h:77:20 */ 598 type X__uint_least64_t = X__uint64_t /* _types.h:78:21 */ 599 600 // 7.18.1.3 Fastest minimum-width integer types 601 type X__int_fast8_t = X__int32_t /* _types.h:81:20 */ 602 type X__uint_fast8_t = X__uint32_t /* _types.h:82:21 */ 603 type X__int_fast16_t = X__int32_t /* _types.h:83:20 */ 604 type X__uint_fast16_t = X__uint32_t /* _types.h:84:21 */ 605 type X__int_fast32_t = X__int32_t /* _types.h:85:20 */ 606 type X__uint_fast32_t = X__uint32_t /* _types.h:86:21 */ 607 type X__int_fast64_t = X__int64_t /* _types.h:87:20 */ 608 type X__uint_fast64_t = X__uint64_t /* _types.h:88:21 */ 609 610 // 7.18.1.4 Integer types capable of holding object pointers 611 type X__intptr_t = int64 /* _types.h:103:16 */ 612 type X__uintptr_t = uint64 /* _types.h:104:24 */ 613 614 // 7.18.1.5 Greatest-width integer types 615 type X__intmax_t = X__int64_t /* _types.h:107:20 */ 616 type X__uintmax_t = X__uint64_t /* _types.h:108:21 */ 617 618 // Register size 619 type X__register_t = int64 /* _types.h:111:16 */ 620 621 // VM system types 622 type X__vaddr_t = uint64 /* _types.h:114:24 */ 623 type X__paddr_t = uint64 /* _types.h:115:24 */ 624 type X__vsize_t = uint64 /* _types.h:116:24 */ 625 type X__psize_t = uint64 /* _types.h:117:24 */ 626 627 // Standard system types 628 type X__double_t = float64 /* _types.h:120:18 */ 629 type X__float_t = float32 /* _types.h:121:17 */ 630 type X__ptrdiff_t = int64 /* _types.h:122:16 */ 631 type X__size_t = uint64 /* _types.h:123:24 */ 632 type X__ssize_t = int64 /* _types.h:124:16 */ 633 type X__va_list = X__builtin_va_list /* _types.h:126:27 */ 634 635 // Wide character support types 636 type X__wchar_t = int32 /* _types.h:133:15 */ 637 type X__wint_t = int32 /* _types.h:135:15 */ 638 type X__rune_t = int32 /* _types.h:136:15 */ 639 type X__wctrans_t = uintptr /* _types.h:137:14 */ 640 type X__wctype_t = uintptr /* _types.h:138:14 */ 641 642 type X__blkcnt_t = X__int64_t /* _types.h:39:19 */ // blocks allocated for file 643 type X__blksize_t = X__int32_t /* _types.h:40:19 */ // optimal blocksize for I/O 644 type X__clock_t = X__int64_t /* _types.h:41:19 */ // ticks in CLOCKS_PER_SEC 645 type X__clockid_t = X__int32_t /* _types.h:42:19 */ // CLOCK_* identifiers 646 type X__cpuid_t = uint64 /* _types.h:43:23 */ // CPU id 647 type X__dev_t = X__int32_t /* _types.h:44:19 */ // device number 648 type X__fixpt_t = X__uint32_t /* _types.h:45:20 */ // fixed point number 649 type X__fsblkcnt_t = X__uint64_t /* _types.h:46:20 */ // file system block count 650 type X__fsfilcnt_t = X__uint64_t /* _types.h:47:20 */ // file system file count 651 type X__gid_t = X__uint32_t /* _types.h:48:20 */ // group id 652 type X__id_t = X__uint32_t /* _types.h:49:20 */ // may contain pid, uid or gid 653 type X__in_addr_t = X__uint32_t /* _types.h:50:20 */ // base type for internet address 654 type X__in_port_t = X__uint16_t /* _types.h:51:20 */ // IP port type 655 type X__ino_t = X__uint64_t /* _types.h:52:20 */ // inode number 656 type X__key_t = int64 /* _types.h:53:15 */ // IPC key (for Sys V IPC) 657 type X__mode_t = X__uint32_t /* _types.h:54:20 */ // permissions 658 type X__nlink_t = X__uint32_t /* _types.h:55:20 */ // link count 659 type X__off_t = X__int64_t /* _types.h:56:19 */ // file offset or size 660 type X__pid_t = X__int32_t /* _types.h:57:19 */ // process id 661 type X__rlim_t = X__uint64_t /* _types.h:58:20 */ // resource limit 662 type X__sa_family_t = X__uint8_t /* _types.h:59:19 */ // sockaddr address family type 663 type X__segsz_t = X__int32_t /* _types.h:60:19 */ // segment size 664 type X__socklen_t = X__uint32_t /* _types.h:61:20 */ // length type for network syscalls 665 type X__suseconds_t = int64 /* _types.h:62:15 */ // microseconds (signed) 666 type X__time_t = X__int64_t /* _types.h:63:19 */ // epoch time 667 type X__timer_t = X__int32_t /* _types.h:64:19 */ // POSIX timer identifiers 668 type X__uid_t = X__uint32_t /* _types.h:65:20 */ // user id 669 type X__useconds_t = X__uint32_t /* _types.h:66:20 */ // microseconds 670 671 // mbstate_t is an opaque object to keep conversion state, during multibyte 672 // stream conversions. The content must not be referenced by user programs. 673 type X__mbstate_t = struct { 674 F__ccgo_pad1 [0]uint64 675 F__mbstate8 [128]int8 676 } /* _types.h:75:3 */ 677 678 // Tell sys/endian.h we have MD variants of the swap macros. 679 680 // Note that these macros evaluate their arguments several times. 681 682 // Public names 683 684 // These are specified to be function-like macros to match the spec 685 686 // POSIX names 687 688 // original BSD names 689 690 // these were exposed here before 691 692 // ancient stuff 693 694 type U_char = uint8 /* types.h:51:23 */ 695 type U_short = uint16 /* types.h:52:24 */ 696 type U_int = uint32 /* types.h:53:22 */ 697 type U_long = uint64 /* types.h:54:23 */ 698 699 type Unchar = uint8 /* types.h:56:23 */ // Sys V compatibility 700 type Ushort = uint16 /* types.h:57:24 */ // Sys V compatibility 701 type Uint = uint32 /* types.h:58:22 */ // Sys V compatibility 702 type Ulong = uint64 /* types.h:59:23 */ // Sys V compatibility 703 704 type Cpuid_t = X__cpuid_t /* types.h:61:19 */ // CPU id 705 type Register_t = X__register_t /* types.h:62:22 */ // register-sized type 706 707 // XXX The exact-width bit types should only be exposed if __BSD_VISIBLE 708 // but the rest of the includes are not ready for that yet. 709 710 type Int8_t = X__int8_t /* types.h:75:19 */ 711 712 type Uint8_t = X__uint8_t /* types.h:80:20 */ 713 714 type Int16_t = X__int16_t /* types.h:85:20 */ 715 716 type Uint16_t = X__uint16_t /* types.h:90:21 */ 717 718 type Int32_t = X__int32_t /* types.h:95:20 */ 719 720 type Uint32_t = X__uint32_t /* types.h:100:21 */ 721 722 type Int64_t = X__int64_t /* types.h:105:20 */ 723 724 type Uint64_t = X__uint64_t /* types.h:110:21 */ 725 726 // BSD-style unsigned bits types 727 type U_int8_t = X__uint8_t /* types.h:114:19 */ 728 type U_int16_t = X__uint16_t /* types.h:115:20 */ 729 type U_int32_t = X__uint32_t /* types.h:116:20 */ 730 type U_int64_t = X__uint64_t /* types.h:117:20 */ 731 732 // quads, deprecated in favor of 64 bit int types 733 type Quad_t = X__int64_t /* types.h:120:19 */ 734 type U_quad_t = X__uint64_t /* types.h:121:20 */ 735 736 // VM system types 737 type Vaddr_t = X__vaddr_t /* types.h:125:19 */ 738 type Paddr_t = X__paddr_t /* types.h:126:19 */ 739 type Vsize_t = X__vsize_t /* types.h:127:19 */ 740 type Psize_t = X__psize_t /* types.h:128:19 */ 741 742 // Standard system types 743 type Blkcnt_t = X__blkcnt_t /* types.h:132:20 */ // blocks allocated for file 744 type Blksize_t = X__blksize_t /* types.h:133:21 */ // optimal blocksize for I/O 745 type Caddr_t = uintptr /* types.h:134:14 */ // core address 746 type Daddr32_t = X__int32_t /* types.h:135:19 */ // 32-bit disk address 747 type Daddr_t = X__int64_t /* types.h:136:19 */ // 64-bit disk address 748 type Dev_t = X__dev_t /* types.h:137:18 */ // device number 749 type Fixpt_t = X__fixpt_t /* types.h:138:19 */ // fixed point number 750 type Gid_t = X__gid_t /* types.h:139:18 */ // group id 751 type Id_t = X__id_t /* types.h:140:17 */ // may contain pid, uid or gid 752 type Ino_t = X__ino_t /* types.h:141:18 */ // inode number 753 type Key_t = X__key_t /* types.h:142:18 */ // IPC key (for Sys V IPC) 754 type Mode_t = X__mode_t /* types.h:143:18 */ // permissions 755 type Nlink_t = X__nlink_t /* types.h:144:19 */ // link count 756 type Rlim_t = X__rlim_t /* types.h:145:18 */ // resource limit 757 type Segsz_t = X__segsz_t /* types.h:146:19 */ // segment size 758 type Uid_t = X__uid_t /* types.h:147:18 */ // user id 759 type Useconds_t = X__useconds_t /* types.h:148:22 */ // microseconds 760 type Suseconds_t = X__suseconds_t /* types.h:149:23 */ // microseconds (signed) 761 type Fsblkcnt_t = X__fsblkcnt_t /* types.h:150:22 */ // file system block count 762 type Fsfilcnt_t = X__fsfilcnt_t /* types.h:151:22 */ // file system file count 763 764 // The following types may be defined in multiple header files. 765 type Clock_t = X__clock_t /* types.h:158:19 */ 766 767 type Clockid_t = X__clockid_t /* types.h:163:21 */ 768 769 type Pid_t = X__pid_t /* types.h:168:18 */ 770 771 type Ssize_t = X__ssize_t /* types.h:178:19 */ 772 773 type Time_t = X__time_t /* types.h:183:18 */ 774 775 type Timer_t = X__timer_t /* types.h:188:19 */ 776 777 type Off_t = X__off_t /* types.h:193:18 */ 778 779 // Major, minor numbers, dev_t's. 780 781 // File status flags: these are used by open(2), fcntl(2). 782 // They are also used (indirectly) in the kernel file structure f_flags, 783 // which is a superset of the open/fcntl flags. Open flags and f_flags 784 // are inter-convertible using OFLAGS(fflags) and FFLAGS(oflags). 785 // Open/fcntl flags begin with O_; kernel-internal flags begin with F. 786 // open-only flags 787 788 // Kernel encoding of open mode; separate read and write bits that are 789 // independently testable: 1 greater than the above. 790 // 791 // XXX 792 // FREAD and FWRITE are excluded from the #ifdef _KERNEL so that TIOCFLUSH, 793 // which was documented to use FREAD/FWRITE, continues to work. 794 795 // POSIX 1003.1 specifies a higher granularity for synchronous operations 796 // than we support. Since synchronicity is all or nothing in OpenBSD 797 // we just define these to be the same as O_SYNC. 798 799 // defined by POSIX 1003.1; BSD default, this bit is not required 800 801 // defined by POSIX Issue 7 802 803 // The O_* flags used to have only F* names, which were used in the kernel 804 // and by fcntl. We retain the F* names for the kernel f_flags field 805 // and for backward compatibility for fcntl. 806 807 // Constants used for fcntl(2) 808 809 // command values 810 811 // file descriptor flags (F_GETFD, F_SETFD) 812 813 // record locking flags (F_GETLK, F_SETLK, F_SETLKW) 814 815 // Advisory file segment locking data type - 816 // information passed to system by user 817 type Flock = struct { 818 Fl_start Off_t 819 Fl_len Off_t 820 Fl_pid Pid_t 821 Fl_type int16 822 Fl_whence int16 823 } /* fcntl.h:180:1 */ 824 825 var _ int8 /* gen.c:2:13: */