fcntl_linux_amd64.go 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087
  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_linux_amd64.go -pkgname fcntl', DO NOT EDIT.
  2. package fcntl
  3. import (
  4. "math"
  5. "reflect"
  6. "sync/atomic"
  7. "unsafe"
  8. )
  9. var _ = math.Pi
  10. var _ reflect.Kind
  11. var _ atomic.Value
  12. var _ unsafe.Pointer
  13. const (
  14. AT_EACCESS = 0x200 // fcntl-linux.h:388:1:
  15. AT_FDCWD = -100 // fcntl-linux.h:371:1:
  16. AT_REMOVEDIR = 0x200 // fcntl-linux.h:375:1:
  17. AT_SYMLINK_FOLLOW = 0x400 // fcntl-linux.h:377:1:
  18. AT_SYMLINK_NOFOLLOW = 0x100 // fcntl-linux.h:374:1:
  19. FAPPEND = 1024 // fcntl-linux.h:304:1:
  20. FASYNC = 8192 // fcntl-linux.h:306:1:
  21. FD_CLOEXEC = 1 // fcntl-linux.h:219:1:
  22. FFSYNC = 1052672 // fcntl-linux.h:305:1:
  23. FNDELAY = 2048 // fcntl-linux.h:308:1:
  24. FNONBLOCK = 2048 // fcntl-linux.h:307:1:
  25. F_DUPFD = 0 // fcntl-linux.h:167:1:
  26. F_DUPFD_CLOEXEC = 1030 // fcntl-linux.h:214:1:
  27. F_EXLCK = 4 // fcntl-linux.h:231:1:
  28. F_GETFD = 1 // fcntl-linux.h:168:1:
  29. F_GETFL = 3 // fcntl-linux.h:170:1:
  30. F_GETLK = 5 // fcntl-linux.h:109:1:
  31. F_GETLK64 = 5 // fcntl.h:29:1:
  32. F_GETOWN = 9 // fcntl-linux.h:180:1:
  33. F_LOCK = 1 // fcntl.h:238:1:
  34. F_OK = 0 // fcntl.h:131:1:
  35. F_RDLCK = 0 // fcntl-linux.h:223:1:
  36. F_SETFD = 2 // fcntl-linux.h:169:1:
  37. F_SETFL = 4 // fcntl-linux.h:171:1:
  38. F_SETLK = 6 // fcntl-linux.h:110:1:
  39. F_SETLK64 = 6 // fcntl.h:30:1:
  40. F_SETLKW = 7 // fcntl-linux.h:111:1:
  41. F_SETLKW64 = 7 // fcntl.h:31:1:
  42. F_SETOWN = 8 // fcntl-linux.h:179:1:
  43. F_SHLCK = 8 // fcntl-linux.h:232:1:
  44. F_TEST = 3 // fcntl.h:240:1:
  45. F_TLOCK = 2 // fcntl.h:239:1:
  46. F_ULOCK = 0 // fcntl.h:237:1:
  47. F_UNLCK = 2 // fcntl-linux.h:225:1:
  48. F_WRLCK = 1 // fcntl-linux.h:224:1:
  49. LOCK_EX = 2 // fcntl-linux.h:238:1:
  50. LOCK_NB = 4 // fcntl-linux.h:239:1:
  51. LOCK_SH = 1 // fcntl-linux.h:237:1:
  52. LOCK_UN = 8 // fcntl-linux.h:241:1:
  53. O_ACCMODE = 0003 // fcntl-linux.h:42:1:
  54. O_APPEND = 02000 // fcntl-linux.h:59:1:
  55. O_ASYNC = 020000 // fcntl-linux.h:72:1:
  56. O_CLOEXEC = 524288 // fcntl-linux.h:144:1:
  57. O_CREAT = 0100 // fcntl-linux.h:47:1:
  58. O_DIRECTORY = 65536 // fcntl-linux.h:142:1:
  59. O_DSYNC = 4096 // fcntl-linux.h:158:1:
  60. O_EXCL = 0200 // fcntl-linux.h:50:1:
  61. O_FSYNC = 1052672 // fcntl-linux.h:70:1:
  62. O_NDELAY = 2048 // fcntl-linux.h:65:1:
  63. O_NOCTTY = 0400 // fcntl-linux.h:53:1:
  64. O_NOFOLLOW = 131072 // fcntl-linux.h:143:1:
  65. O_NONBLOCK = 04000 // fcntl-linux.h:62:1:
  66. O_RDONLY = 00 // fcntl-linux.h:43:1:
  67. O_RDWR = 02 // fcntl-linux.h:45:1:
  68. O_RSYNC = 1052672 // fcntl-linux.h:162:1:
  69. O_SYNC = 04010000 // fcntl-linux.h:68:1:
  70. O_TRUNC = 01000 // fcntl-linux.h:56:1:
  71. O_WRONLY = 01 // fcntl-linux.h:44:1:
  72. POSIX_FADV_DONTNEED = 4 // fcntl-linux.h:321:1:
  73. POSIX_FADV_NOREUSE = 5 // fcntl-linux.h:322:1:
  74. POSIX_FADV_NORMAL = 0 // fcntl-linux.h:317:1:
  75. POSIX_FADV_RANDOM = 1 // fcntl-linux.h:318:1:
  76. POSIX_FADV_SEQUENTIAL = 2 // fcntl-linux.h:319:1:
  77. POSIX_FADV_WILLNEED = 3 // fcntl-linux.h:320:1:
  78. R_OK = 4 // fcntl.h:128:1:
  79. SEEK_CUR = 1 // fcntl.h:138:1:
  80. SEEK_END = 2 // fcntl.h:139:1:
  81. SEEK_SET = 0 // fcntl.h:137:1:
  82. S_IFBLK = 24576 // fcntl.h:83:1:
  83. S_IFCHR = 8192 // fcntl.h:82:1:
  84. S_IFDIR = 16384 // fcntl.h:81:1:
  85. S_IFIFO = 4096 // fcntl.h:86:1:
  86. S_IFLNK = 40960 // fcntl.h:89:1:
  87. S_IFMT = 61440 // fcntl.h:80:1:
  88. S_IFREG = 32768 // fcntl.h:84:1:
  89. S_IFSOCK = 49152 // fcntl.h:92:1:
  90. S_IRGRP = 32 // fcntl.h:111:1:
  91. S_IROTH = 4 // fcntl.h:117:1:
  92. S_IRUSR = 256 // fcntl.h:105:1:
  93. S_IRWXG = 56 // fcntl.h:115:1:
  94. S_IRWXO = 7 // fcntl.h:121:1:
  95. S_IRWXU = 448 // fcntl.h:109:1:
  96. S_ISGID = 1024 // fcntl.h:98:1:
  97. S_ISUID = 2048 // fcntl.h:97:1:
  98. S_ISVTX = 512 // fcntl.h:102:1:
  99. S_IWGRP = 16 // fcntl.h:112:1:
  100. S_IWOTH = 2 // fcntl.h:118:1:
  101. S_IWUSR = 128 // fcntl.h:106:1:
  102. S_IXGRP = 8 // fcntl.h:113:1:
  103. S_IXOTH = 1 // fcntl.h:119:1:
  104. S_IXUSR = 64 // fcntl.h:107:1:
  105. UTIME_NOW = 1073741823 // stat.h:206:1:
  106. UTIME_OMIT = 1073741822 // stat.h:207:1:
  107. W_OK = 2 // fcntl.h:129:1:
  108. X_OK = 1 // fcntl.h:130:1:
  109. X_ATFILE_SOURCE = 1 // features.h:342:1:
  110. X_BITS_ENDIANNESS_H = 1 // endianness.h:2:1:
  111. X_BITS_ENDIAN_H = 1 // endian.h:20:1:
  112. X_BITS_STAT_H = 1 // stat.h:23:1:
  113. X_BITS_TIME64_H = 1 // time64.h:24:1:
  114. X_BITS_TYPESIZES_H = 1 // typesizes.h:24:1:
  115. X_BITS_TYPES_H = 1 // types.h:24:1:
  116. X_DEFAULT_SOURCE = 1 // features.h:227:1:
  117. X_FCNTL_H = 1 // fcntl.h:23:1:
  118. X_FEATURES_H = 1 // features.h:19:1:
  119. X_FILE_OFFSET_BITS = 64 // <builtin>:25:1:
  120. X_LP64 = 1 // <predefined>:284:1:
  121. X_MKNOD_VER_LINUX = 0 // stat.h:41:1:
  122. X_POSIX_C_SOURCE = 200809 // features.h:281:1:
  123. X_POSIX_SOURCE = 1 // features.h:279:1:
  124. X_STATBUF_ST_BLKSIZE = 0 // stat.h:172:1:
  125. X_STATBUF_ST_NSEC = 0 // stat.h:175:1:
  126. X_STATBUF_ST_RDEV = 0 // stat.h:173:1:
  127. X_STAT_VER = 1 // stat.h:44:1:
  128. X_STAT_VER_KERNEL = 0 // stat.h:37:1:
  129. X_STAT_VER_LINUX = 1 // stat.h:38:1:
  130. X_STDC_PREDEF_H = 1 // <predefined>:162:1:
  131. X_STRUCT_TIMESPEC = 1 // struct_timespec.h:3:1:
  132. X_SYS_CDEFS_H = 1 // cdefs.h:19:1:
  133. Linux = 1 // <predefined>:231:1:
  134. Unix = 1 // <predefined>:177:1:
  135. )
  136. type Ptrdiff_t = int64 /* <builtin>:3:26 */
  137. type Size_t = uint64 /* <builtin>:9:23 */
  138. type Wchar_t = int32 /* <builtin>:15:24 */
  139. type X__int128_t = struct {
  140. Flo int64
  141. Fhi int64
  142. } /* <builtin>:21:43 */ // must match modernc.org/mathutil.Int128
  143. type X__uint128_t = struct {
  144. Flo uint64
  145. Fhi uint64
  146. } /* <builtin>:22:44 */ // must match modernc.org/mathutil.Int128
  147. type X__builtin_va_list = uintptr /* <builtin>:46:14 */
  148. type X__float128 = float64 /* <builtin>:47:21 */
  149. // Copyright (C) 1991-2020 Free Software Foundation, Inc.
  150. // This file is part of the GNU C Library.
  151. //
  152. // The GNU C Library is free software; you can redistribute it and/or
  153. // modify it under the terms of the GNU Lesser General Public
  154. // License as published by the Free Software Foundation; either
  155. // version 2.1 of the License, or (at your option) any later version.
  156. //
  157. // The GNU C Library is distributed in the hope that it will be useful,
  158. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  159. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  160. // Lesser General Public License for more details.
  161. //
  162. // You should have received a copy of the GNU Lesser General Public
  163. // License along with the GNU C Library; if not, see
  164. // <https://www.gnu.org/licenses/>.
  165. // POSIX Standard: 6.5 File Control Operations <fcntl.h>
  166. // Copyright (C) 1991-2020 Free Software Foundation, Inc.
  167. // This file is part of the GNU C Library.
  168. //
  169. // The GNU C Library is free software; you can redistribute it and/or
  170. // modify it under the terms of the GNU Lesser General Public
  171. // License as published by the Free Software Foundation; either
  172. // version 2.1 of the License, or (at your option) any later version.
  173. //
  174. // The GNU C Library is distributed in the hope that it will be useful,
  175. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  176. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  177. // Lesser General Public License for more details.
  178. //
  179. // You should have received a copy of the GNU Lesser General Public
  180. // License along with the GNU C Library; if not, see
  181. // <https://www.gnu.org/licenses/>.
  182. // These are defined by the user (or the compiler)
  183. // to specify the desired environment:
  184. //
  185. // __STRICT_ANSI__ ISO Standard C.
  186. // _ISOC99_SOURCE Extensions to ISO C89 from ISO C99.
  187. // _ISOC11_SOURCE Extensions to ISO C99 from ISO C11.
  188. // _ISOC2X_SOURCE Extensions to ISO C99 from ISO C2X.
  189. // __STDC_WANT_LIB_EXT2__
  190. // Extensions to ISO C99 from TR 27431-2:2010.
  191. // __STDC_WANT_IEC_60559_BFP_EXT__
  192. // Extensions to ISO C11 from TS 18661-1:2014.
  193. // __STDC_WANT_IEC_60559_FUNCS_EXT__
  194. // Extensions to ISO C11 from TS 18661-4:2015.
  195. // __STDC_WANT_IEC_60559_TYPES_EXT__
  196. // Extensions to ISO C11 from TS 18661-3:2015.
  197. //
  198. // _POSIX_SOURCE IEEE Std 1003.1.
  199. // _POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2;
  200. // if >=199309L, add IEEE Std 1003.1b-1993;
  201. // if >=199506L, add IEEE Std 1003.1c-1995;
  202. // if >=200112L, all of IEEE 1003.1-2004
  203. // if >=200809L, all of IEEE 1003.1-2008
  204. // _XOPEN_SOURCE Includes POSIX and XPG things. Set to 500 if
  205. // Single Unix conformance is wanted, to 600 for the
  206. // sixth revision, to 700 for the seventh revision.
  207. // _XOPEN_SOURCE_EXTENDED XPG things and X/Open Unix extensions.
  208. // _LARGEFILE_SOURCE Some more functions for correct standard I/O.
  209. // _LARGEFILE64_SOURCE Additional functionality from LFS for large files.
  210. // _FILE_OFFSET_BITS=N Select default filesystem interface.
  211. // _ATFILE_SOURCE Additional *at interfaces.
  212. // _GNU_SOURCE All of the above, plus GNU extensions.
  213. // _DEFAULT_SOURCE The default set of features (taking precedence over
  214. // __STRICT_ANSI__).
  215. //
  216. // _FORTIFY_SOURCE Add security hardening to many library functions.
  217. // Set to 1 or 2; 2 performs stricter checks than 1.
  218. //
  219. // _REENTRANT, _THREAD_SAFE
  220. // Obsolete; equivalent to _POSIX_C_SOURCE=199506L.
  221. //
  222. // The `-ansi' switch to the GNU C compiler, and standards conformance
  223. // options such as `-std=c99', define __STRICT_ANSI__. If none of
  224. // these are defined, or if _DEFAULT_SOURCE is defined, the default is
  225. // to have _POSIX_SOURCE set to one and _POSIX_C_SOURCE set to
  226. // 200809L, as well as enabling miscellaneous functions from BSD and
  227. // SVID. If more than one of these are defined, they accumulate. For
  228. // example __STRICT_ANSI__, _POSIX_SOURCE and _POSIX_C_SOURCE together
  229. // give you ISO C, 1003.1, and 1003.2, but nothing else.
  230. //
  231. // These are defined by this file and are used by the
  232. // header files to decide what to declare or define:
  233. //
  234. // __GLIBC_USE (F) Define things from feature set F. This is defined
  235. // to 1 or 0; the subsequent macros are either defined
  236. // or undefined, and those tests should be moved to
  237. // __GLIBC_USE.
  238. // __USE_ISOC11 Define ISO C11 things.
  239. // __USE_ISOC99 Define ISO C99 things.
  240. // __USE_ISOC95 Define ISO C90 AMD1 (C95) things.
  241. // __USE_ISOCXX11 Define ISO C++11 things.
  242. // __USE_POSIX Define IEEE Std 1003.1 things.
  243. // __USE_POSIX2 Define IEEE Std 1003.2 things.
  244. // __USE_POSIX199309 Define IEEE Std 1003.1, and .1b things.
  245. // __USE_POSIX199506 Define IEEE Std 1003.1, .1b, .1c and .1i things.
  246. // __USE_XOPEN Define XPG things.
  247. // __USE_XOPEN_EXTENDED Define X/Open Unix things.
  248. // __USE_UNIX98 Define Single Unix V2 things.
  249. // __USE_XOPEN2K Define XPG6 things.
  250. // __USE_XOPEN2KXSI Define XPG6 XSI things.
  251. // __USE_XOPEN2K8 Define XPG7 things.
  252. // __USE_XOPEN2K8XSI Define XPG7 XSI things.
  253. // __USE_LARGEFILE Define correct standard I/O things.
  254. // __USE_LARGEFILE64 Define LFS things with separate names.
  255. // __USE_FILE_OFFSET64 Define 64bit interface as default.
  256. // __USE_MISC Define things from 4.3BSD or System V Unix.
  257. // __USE_ATFILE Define *at interfaces and AT_* constants for them.
  258. // __USE_GNU Define GNU extensions.
  259. // __USE_FORTIFY_LEVEL Additional security measures used, according to level.
  260. //
  261. // The macros `__GNU_LIBRARY__', `__GLIBC__', and `__GLIBC_MINOR__' are
  262. // defined by this file unconditionally. `__GNU_LIBRARY__' is provided
  263. // only for compatibility. All new code should use the other symbols
  264. // to test for features.
  265. //
  266. // All macros listed above as possibly being defined by this file are
  267. // explicitly undefined if they are not explicitly defined.
  268. // Feature-test macros that are not defined by the user or compiler
  269. // but are implied by the other feature-test macros defined (or by the
  270. // lack of any definitions) are defined by the file.
  271. //
  272. // ISO C feature test macros depend on the definition of the macro
  273. // when an affected header is included, not when the first system
  274. // header is included, and so they are handled in
  275. // <bits/libc-header-start.h>, which does not have a multiple include
  276. // guard. Feature test macros that can be handled from the first
  277. // system header included are handled here.
  278. // Undefine everything, so we get a clean slate.
  279. // Suppress kernel-name space pollution unless user expressedly asks
  280. // for it.
  281. // Convenience macro to test the version of gcc.
  282. // Use like this:
  283. // #if __GNUC_PREREQ (2,8)
  284. // ... code requiring gcc 2.8 or later ...
  285. // #endif
  286. // Note: only works for GCC 2.0 and later, because __GNUC_MINOR__ was
  287. // added in 2.0.
  288. // Similarly for clang. Features added to GCC after version 4.2 may
  289. // or may not also be available in clang, and clang's definitions of
  290. // __GNUC(_MINOR)__ are fixed at 4 and 2 respectively. Not all such
  291. // features can be queried via __has_extension/__has_feature.
  292. // Whether to use feature set F.
  293. // _BSD_SOURCE and _SVID_SOURCE are deprecated aliases for
  294. // _DEFAULT_SOURCE. If _DEFAULT_SOURCE is present we do not
  295. // issue a warning; the expectation is that the source is being
  296. // transitioned to use the new macro.
  297. // If _GNU_SOURCE was defined by the user, turn on all the other features.
  298. // If nothing (other than _GNU_SOURCE and _DEFAULT_SOURCE) is defined,
  299. // define _DEFAULT_SOURCE.
  300. // This is to enable the ISO C2X extension.
  301. // This is to enable the ISO C11 extension.
  302. // This is to enable the ISO C99 extension.
  303. // This is to enable the ISO C90 Amendment 1:1995 extension.
  304. // If none of the ANSI/POSIX macros are defined, or if _DEFAULT_SOURCE
  305. // is defined, use POSIX.1-2008 (or another version depending on
  306. // _XOPEN_SOURCE).
  307. // Some C libraries once required _REENTRANT and/or _THREAD_SAFE to be
  308. // defined in all multithreaded code. GNU libc has not required this
  309. // for many years. We now treat them as compatibility synonyms for
  310. // _POSIX_C_SOURCE=199506L, which is the earliest level of POSIX with
  311. // comprehensive support for multithreaded code. Using them never
  312. // lowers the selected level of POSIX conformance, only raises it.
  313. // The function 'gets' existed in C89, but is impossible to use
  314. // safely. It has been removed from ISO C11 and ISO C++14. Note: for
  315. // compatibility with various implementations of <cstdio>, this test
  316. // must consider only the value of __cplusplus when compiling C++.
  317. // GNU formerly extended the scanf functions with modified format
  318. // specifiers %as, %aS, and %a[...] that allocate a buffer for the
  319. // input using malloc. This extension conflicts with ISO C99, which
  320. // defines %a as a standalone format specifier that reads a floating-
  321. // point number; moreover, POSIX.1-2008 provides the same feature
  322. // using the modifier letter 'm' instead (%ms, %mS, %m[...]).
  323. //
  324. // We now follow C99 unless GNU extensions are active and the compiler
  325. // is specifically in C89 or C++98 mode (strict or not). For
  326. // instance, with GCC, -std=gnu11 will have C99-compliant scanf with
  327. // or without -D_GNU_SOURCE, but -std=c89 -D_GNU_SOURCE will have the
  328. // old extension.
  329. // Get definitions of __STDC_* predefined macros, if the compiler has
  330. // not preincluded this header automatically.
  331. // Copyright (C) 1991-2020 Free Software Foundation, Inc.
  332. // This file is part of the GNU C Library.
  333. //
  334. // The GNU C Library is free software; you can redistribute it and/or
  335. // modify it under the terms of the GNU Lesser General Public
  336. // License as published by the Free Software Foundation; either
  337. // version 2.1 of the License, or (at your option) any later version.
  338. //
  339. // The GNU C Library is distributed in the hope that it will be useful,
  340. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  341. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  342. // Lesser General Public License for more details.
  343. //
  344. // You should have received a copy of the GNU Lesser General Public
  345. // License along with the GNU C Library; if not, see
  346. // <https://www.gnu.org/licenses/>.
  347. // This macro indicates that the installed library is the GNU C Library.
  348. // For historic reasons the value now is 6 and this will stay from now
  349. // on. The use of this variable is deprecated. Use __GLIBC__ and
  350. // __GLIBC_MINOR__ now (see below) when you want to test for a specific
  351. // GNU C library version and use the values in <gnu/lib-names.h> to get
  352. // the sonames of the shared libraries.
  353. // Major and minor version number of the GNU C library package. Use
  354. // these macros to test for features in specific releases.
  355. // This is here only because every header file already includes this one.
  356. // Copyright (C) 1992-2020 Free Software Foundation, Inc.
  357. // This file is part of the GNU C Library.
  358. //
  359. // The GNU C Library is free software; you can redistribute it and/or
  360. // modify it under the terms of the GNU Lesser General Public
  361. // License as published by the Free Software Foundation; either
  362. // version 2.1 of the License, or (at your option) any later version.
  363. //
  364. // The GNU C Library is distributed in the hope that it will be useful,
  365. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  366. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  367. // Lesser General Public License for more details.
  368. //
  369. // You should have received a copy of the GNU Lesser General Public
  370. // License along with the GNU C Library; if not, see
  371. // <https://www.gnu.org/licenses/>.
  372. // We are almost always included from features.h.
  373. // The GNU libc does not support any K&R compilers or the traditional mode
  374. // of ISO C compilers anymore. Check for some of the combinations not
  375. // anymore supported.
  376. // Some user header file might have defined this before.
  377. // All functions, except those with callbacks or those that
  378. // synchronize memory, are leaf functions.
  379. // GCC can always grok prototypes. For C++ programs we add throw()
  380. // to help it optimize the function calls. But this works only with
  381. // gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions
  382. // as non-throwing using a function attribute since programs can use
  383. // the -fexceptions options for C code as well.
  384. // Compilers that are not clang may object to
  385. // #if defined __clang__ && __has_extension(...)
  386. // even though they do not need to evaluate the right-hand side of the &&.
  387. // These two macros are not used in glibc anymore. They are kept here
  388. // only because some other projects expect the macros to be defined.
  389. // For these things, GCC behaves the ANSI way normally,
  390. // and the non-ANSI way under -traditional.
  391. // This is not a typedef so `const __ptr_t' does the right thing.
  392. // C++ needs to know that types and declarations are C, not C++.
  393. // Fortify support.
  394. // Support for flexible arrays.
  395. // Headers that should use flexible arrays only if they're "real"
  396. // (e.g. only if they won't affect sizeof()) should test
  397. // #if __glibc_c99_flexarr_available.
  398. // __asm__ ("xyz") is used throughout the headers to rename functions
  399. // at the assembly language level. This is wrapped by the __REDIRECT
  400. // macro, in order to support compilers that can do this some other
  401. // way. When compilers don't support asm-names at all, we have to do
  402. // preprocessor tricks instead (which don't have exactly the right
  403. // semantics, but it's the best we can do).
  404. //
  405. // Example:
  406. // int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid);
  407. //
  408. // #elif __SOME_OTHER_COMPILER__
  409. //
  410. // # define __REDIRECT(name, proto, alias) name proto; _Pragma("let " #name " = " #alias)
  411. // GCC has various useful declarations that can be made with the
  412. // `__attribute__' syntax. All of the ways we use this do fine if
  413. // they are omitted for compilers that don't understand it.
  414. // At some point during the gcc 2.96 development the `malloc' attribute
  415. // for functions was introduced. We don't want to use it unconditionally
  416. // (although this would be possible) since it generates warnings.
  417. // Tell the compiler which arguments to an allocation function
  418. // indicate the size of the allocation.
  419. // At some point during the gcc 2.96 development the `pure' attribute
  420. // for functions was introduced. We don't want to use it unconditionally
  421. // (although this would be possible) since it generates warnings.
  422. // This declaration tells the compiler that the value is constant.
  423. // At some point during the gcc 3.1 development the `used' attribute
  424. // for functions was introduced. We don't want to use it unconditionally
  425. // (although this would be possible) since it generates warnings.
  426. // Since version 3.2, gcc allows marking deprecated functions.
  427. // Since version 4.5, gcc also allows one to specify the message printed
  428. // when a deprecated function is used. clang claims to be gcc 4.2, but
  429. // may also support this feature.
  430. // At some point during the gcc 2.8 development the `format_arg' attribute
  431. // for functions was introduced. We don't want to use it unconditionally
  432. // (although this would be possible) since it generates warnings.
  433. // If several `format_arg' attributes are given for the same function, in
  434. // gcc-3.0 and older, all but the last one are ignored. In newer gccs,
  435. // all designated arguments are considered.
  436. // At some point during the gcc 2.97 development the `strfmon' format
  437. // attribute for functions was introduced. We don't want to use it
  438. // unconditionally (although this would be possible) since it
  439. // generates warnings.
  440. // The nonull function attribute allows to mark pointer parameters which
  441. // must not be NULL.
  442. // If fortification mode, we warn about unused results of certain
  443. // function calls which can lead to problems.
  444. // Forces a function to be always inlined.
  445. // The Linux kernel defines __always_inline in stddef.h (283d7573), and
  446. // it conflicts with this definition. Therefore undefine it first to
  447. // allow either header to be included first.
  448. // Associate error messages with the source location of the call site rather
  449. // than with the source location inside the function.
  450. // GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
  451. // inline semantics, unless -fgnu89-inline is used. Using __GNUC_STDC_INLINE__
  452. // or __GNUC_GNU_INLINE is not a good enough check for gcc because gcc versions
  453. // older than 4.3 may define these macros and still not guarantee GNU inlining
  454. // semantics.
  455. //
  456. // clang++ identifies itself as gcc-4.2, but has support for GNU inlining
  457. // semantics, that can be checked for by using the __GNUC_STDC_INLINE_ and
  458. // __GNUC_GNU_INLINE__ macro definitions.
  459. // GCC 4.3 and above allow passing all anonymous arguments of an
  460. // __extern_always_inline function to some other vararg function.
  461. // It is possible to compile containing GCC extensions even if GCC is
  462. // run in pedantic mode if the uses are carefully marked using the
  463. // `__extension__' keyword. But this is not generally available before
  464. // version 2.8.
  465. // __restrict is known in EGCS 1.2 and above.
  466. // ISO C99 also allows to declare arrays as non-overlapping. The syntax is
  467. // array_name[restrict]
  468. // GCC 3.1 supports this.
  469. // Describes a char array whose address can safely be passed as the first
  470. // argument to strncpy and strncat, as the char array is not necessarily
  471. // a NUL-terminated string.
  472. // Undefine (also defined in libc-symbols.h).
  473. // Copies attributes from the declaration or type referenced by
  474. // the argument.
  475. // Determine the wordsize from the preprocessor defines.
  476. // Both x86-64 and x32 use the 64-bit system call interface.
  477. // Properties of long double type. ldbl-96 version.
  478. // Copyright (C) 2016-2020 Free Software Foundation, Inc.
  479. // This file is part of the GNU C Library.
  480. //
  481. // The GNU C Library is free software; you can redistribute it and/or
  482. // modify it under the terms of the GNU Lesser General Public
  483. // License published by the Free Software Foundation; either
  484. // version 2.1 of the License, or (at your option) any later version.
  485. //
  486. // The GNU C Library is distributed in the hope that it will be useful,
  487. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  488. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  489. // Lesser General Public License for more details.
  490. //
  491. // You should have received a copy of the GNU Lesser General Public
  492. // License along with the GNU C Library; if not, see
  493. // <https://www.gnu.org/licenses/>.
  494. // long double is distinct from double, so there is nothing to
  495. // define here.
  496. // __glibc_macro_warning (MESSAGE) issues warning MESSAGE. This is
  497. // intended for use in preprocessor macros.
  498. //
  499. // Note: MESSAGE must be a _single_ string; concatenation of string
  500. // literals is not supported.
  501. // Generic selection (ISO C11) is a C-only feature, available in GCC
  502. // since version 4.9. Previous versions do not provide generic
  503. // selection, even though they might set __STDC_VERSION__ to 201112L,
  504. // when in -std=c11 mode. Thus, we must check for !defined __GNUC__
  505. // when testing __STDC_VERSION__ for generic selection support.
  506. // On the other hand, Clang also defines __GNUC__, so a clang-specific
  507. // check is required to enable the use of generic selection.
  508. // If we don't have __REDIRECT, prototypes will be missing if
  509. // __USE_FILE_OFFSET64 but not __USE_LARGEFILE[64].
  510. // Decide whether we can define 'extern inline' functions in headers.
  511. // This is here only because every header file already includes this one.
  512. // Get the definitions of all the appropriate `__stub_FUNCTION' symbols.
  513. // <gnu/stubs.h> contains `#define __stub_FUNCTION' when FUNCTION is a stub
  514. // that will always return failure (and set errno to ENOSYS).
  515. // This file is automatically generated.
  516. // This file selects the right generated file of `__stub_FUNCTION' macros
  517. // based on the architecture being compiled for.
  518. // This file is automatically generated.
  519. // It defines a symbol `__stub_FUNCTION' for each function
  520. // in the C library which is a stub, meaning it will fail
  521. // every time called, usually setting errno to ENOSYS.
  522. // This must be early so <bits/fcntl.h> can define types winningly.
  523. // Get __mode_t, __dev_t and __off_t .
  524. // bits/types.h -- definitions of __*_t types underlying *_t types.
  525. // Copyright (C) 2002-2020 Free Software Foundation, Inc.
  526. // This file is part of the GNU C Library.
  527. //
  528. // The GNU C Library is free software; you can redistribute it and/or
  529. // modify it under the terms of the GNU Lesser General Public
  530. // License as published by the Free Software Foundation; either
  531. // version 2.1 of the License, or (at your option) any later version.
  532. //
  533. // The GNU C Library is distributed in the hope that it will be useful,
  534. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  535. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  536. // Lesser General Public License for more details.
  537. //
  538. // You should have received a copy of the GNU Lesser General Public
  539. // License along with the GNU C Library; if not, see
  540. // <https://www.gnu.org/licenses/>.
  541. // Never include this file directly; use <sys/types.h> instead.
  542. // Copyright (C) 1991-2020 Free Software Foundation, Inc.
  543. // This file is part of the GNU C Library.
  544. //
  545. // The GNU C Library is free software; you can redistribute it and/or
  546. // modify it under the terms of the GNU Lesser General Public
  547. // License as published by the Free Software Foundation; either
  548. // version 2.1 of the License, or (at your option) any later version.
  549. //
  550. // The GNU C Library is distributed in the hope that it will be useful,
  551. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  552. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  553. // Lesser General Public License for more details.
  554. //
  555. // You should have received a copy of the GNU Lesser General Public
  556. // License along with the GNU C Library; if not, see
  557. // <https://www.gnu.org/licenses/>.
  558. // Determine the wordsize from the preprocessor defines.
  559. // Both x86-64 and x32 use the 64-bit system call interface.
  560. // Bit size of the time_t type at glibc build time, x86-64 and x32 case.
  561. // Copyright (C) 2018-2020 Free Software Foundation, Inc.
  562. // This file is part of the GNU C Library.
  563. //
  564. // The GNU C Library is free software; you can redistribute it and/or
  565. // modify it under the terms of the GNU Lesser General Public
  566. // License as published by the Free Software Foundation; either
  567. // version 2.1 of the License, or (at your option) any later version.
  568. //
  569. // The GNU C Library is distributed in the hope that it will be useful,
  570. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  571. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  572. // Lesser General Public License for more details.
  573. //
  574. // You should have received a copy of the GNU Lesser General Public
  575. // License along with the GNU C Library; if not, see
  576. // <https://www.gnu.org/licenses/>.
  577. // For others, time size is word size.
  578. // Convenience types.
  579. type X__u_char = uint8 /* types.h:31:23 */
  580. type X__u_short = uint16 /* types.h:32:28 */
  581. type X__u_int = uint32 /* types.h:33:22 */
  582. type X__u_long = uint64 /* types.h:34:27 */
  583. // Fixed-size types, underlying types depend on word size and compiler.
  584. type X__int8_t = int8 /* types.h:37:21 */
  585. type X__uint8_t = uint8 /* types.h:38:23 */
  586. type X__int16_t = int16 /* types.h:39:26 */
  587. type X__uint16_t = uint16 /* types.h:40:28 */
  588. type X__int32_t = int32 /* types.h:41:20 */
  589. type X__uint32_t = uint32 /* types.h:42:22 */
  590. type X__int64_t = int64 /* types.h:44:25 */
  591. type X__uint64_t = uint64 /* types.h:45:27 */
  592. // Smallest types with at least a given width.
  593. type X__int_least8_t = X__int8_t /* types.h:52:18 */
  594. type X__uint_least8_t = X__uint8_t /* types.h:53:19 */
  595. type X__int_least16_t = X__int16_t /* types.h:54:19 */
  596. type X__uint_least16_t = X__uint16_t /* types.h:55:20 */
  597. type X__int_least32_t = X__int32_t /* types.h:56:19 */
  598. type X__uint_least32_t = X__uint32_t /* types.h:57:20 */
  599. type X__int_least64_t = X__int64_t /* types.h:58:19 */
  600. type X__uint_least64_t = X__uint64_t /* types.h:59:20 */
  601. // quad_t is also 64 bits.
  602. type X__quad_t = int64 /* types.h:63:18 */
  603. type X__u_quad_t = uint64 /* types.h:64:27 */
  604. // Largest integral types.
  605. type X__intmax_t = int64 /* types.h:72:18 */
  606. type X__uintmax_t = uint64 /* types.h:73:27 */
  607. // The machine-dependent file <bits/typesizes.h> defines __*_T_TYPE
  608. // macros for each of the OS types we define below. The definitions
  609. // of those macros must use the following macros for underlying types.
  610. // We define __S<SIZE>_TYPE and __U<SIZE>_TYPE for the signed and unsigned
  611. // variants of each of the following integer types on this machine.
  612. //
  613. // 16 -- "natural" 16-bit type (always short)
  614. // 32 -- "natural" 32-bit type (always int)
  615. // 64 -- "natural" 64-bit type (long or long long)
  616. // LONG32 -- 32-bit type, traditionally long
  617. // QUAD -- 64-bit type, traditionally long long
  618. // WORD -- natural type of __WORDSIZE bits (int or long)
  619. // LONGWORD -- type of __WORDSIZE bits, traditionally long
  620. //
  621. // We distinguish WORD/LONGWORD, 32/LONG32, and 64/QUAD so that the
  622. // conventional uses of `long' or `long long' type modifiers match the
  623. // types we define, even when a less-adorned type would be the same size.
  624. // This matters for (somewhat) portably writing printf/scanf formats for
  625. // these types, where using the appropriate l or ll format modifiers can
  626. // make the typedefs and the formats match up across all GNU platforms. If
  627. // we used `long' when it's 64 bits where `long long' is expected, then the
  628. // compiler would warn about the formats not matching the argument types,
  629. // and the programmer changing them to shut up the compiler would break the
  630. // program's portability.
  631. //
  632. // Here we assume what is presently the case in all the GCC configurations
  633. // we support: long long is always 64 bits, long is always word/address size,
  634. // and int is always 32 bits.
  635. // No need to mark the typedef with __extension__.
  636. // bits/typesizes.h -- underlying types for *_t. Linux/x86-64 version.
  637. // Copyright (C) 2012-2020 Free Software Foundation, Inc.
  638. // This file is part of the GNU C Library.
  639. //
  640. // The GNU C Library is free software; you can redistribute it and/or
  641. // modify it under the terms of the GNU Lesser General Public
  642. // License as published by the Free Software Foundation; either
  643. // version 2.1 of the License, or (at your option) any later version.
  644. //
  645. // The GNU C Library is distributed in the hope that it will be useful,
  646. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  647. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  648. // Lesser General Public License for more details.
  649. //
  650. // You should have received a copy of the GNU Lesser General Public
  651. // License along with the GNU C Library; if not, see
  652. // <https://www.gnu.org/licenses/>.
  653. // See <bits/types.h> for the meaning of these macros. This file exists so
  654. // that <bits/types.h> need not vary across different GNU platforms.
  655. // X32 kernel interface is 64-bit.
  656. // Tell the libc code that off_t and off64_t are actually the same type
  657. // for all ABI purposes, even if possibly expressed as different base types
  658. // for C type-checking purposes.
  659. // Same for ino_t and ino64_t.
  660. // And for __rlim_t and __rlim64_t.
  661. // And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t.
  662. // Number of descriptors that can fit in an `fd_set'.
  663. // bits/time64.h -- underlying types for __time64_t. Generic version.
  664. // Copyright (C) 2018-2020 Free Software Foundation, Inc.
  665. // This file is part of the GNU C Library.
  666. //
  667. // The GNU C Library is free software; you can redistribute it and/or
  668. // modify it under the terms of the GNU Lesser General Public
  669. // License as published by the Free Software Foundation; either
  670. // version 2.1 of the License, or (at your option) any later version.
  671. //
  672. // The GNU C Library is distributed in the hope that it will be useful,
  673. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  674. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  675. // Lesser General Public License for more details.
  676. //
  677. // You should have received a copy of the GNU Lesser General Public
  678. // License along with the GNU C Library; if not, see
  679. // <https://www.gnu.org/licenses/>.
  680. // Define __TIME64_T_TYPE so that it is always a 64-bit type.
  681. // If we already have 64-bit time type then use it.
  682. type X__dev_t = uint64 /* types.h:145:25 */ // Type of device numbers.
  683. type X__uid_t = uint32 /* types.h:146:25 */ // Type of user identifications.
  684. type X__gid_t = uint32 /* types.h:147:25 */ // Type of group identifications.
  685. type X__ino_t = uint64 /* types.h:148:25 */ // Type of file serial numbers.
  686. type X__ino64_t = uint64 /* types.h:149:27 */ // Type of file serial numbers (LFS).
  687. type X__mode_t = uint32 /* types.h:150:26 */ // Type of file attribute bitmasks.
  688. type X__nlink_t = uint64 /* types.h:151:27 */ // Type of file link counts.
  689. type X__off_t = int64 /* types.h:152:25 */ // Type of file sizes and offsets.
  690. type X__off64_t = int64 /* types.h:153:27 */ // Type of file sizes and offsets (LFS).
  691. type X__pid_t = int32 /* types.h:154:25 */ // Type of process identifications.
  692. type X__fsid_t = struct{ F__val [2]int32 } /* types.h:155:26 */ // Type of file system IDs.
  693. type X__clock_t = int64 /* types.h:156:27 */ // Type of CPU usage counts.
  694. type X__rlim_t = uint64 /* types.h:157:26 */ // Type for resource measurement.
  695. type X__rlim64_t = uint64 /* types.h:158:28 */ // Type for resource measurement (LFS).
  696. type X__id_t = uint32 /* types.h:159:24 */ // General type for IDs.
  697. type X__time_t = int64 /* types.h:160:26 */ // Seconds since the Epoch.
  698. type X__useconds_t = uint32 /* types.h:161:30 */ // Count of microseconds.
  699. type X__suseconds_t = int64 /* types.h:162:31 */ // Signed count of microseconds.
  700. type X__daddr_t = int32 /* types.h:164:27 */ // The type of a disk address.
  701. type X__key_t = int32 /* types.h:165:25 */ // Type of an IPC key.
  702. // Clock ID used in clock and timer functions.
  703. type X__clockid_t = int32 /* types.h:168:29 */
  704. // Timer ID returned by `timer_create'.
  705. type X__timer_t = uintptr /* types.h:171:12 */
  706. // Type to represent block size.
  707. type X__blksize_t = int64 /* types.h:174:29 */
  708. // Types from the Large File Support interface.
  709. // Type to count number of disk blocks.
  710. type X__blkcnt_t = int64 /* types.h:179:28 */
  711. type X__blkcnt64_t = int64 /* types.h:180:30 */
  712. // Type to count file system blocks.
  713. type X__fsblkcnt_t = uint64 /* types.h:183:30 */
  714. type X__fsblkcnt64_t = uint64 /* types.h:184:32 */
  715. // Type to count file system nodes.
  716. type X__fsfilcnt_t = uint64 /* types.h:187:30 */
  717. type X__fsfilcnt64_t = uint64 /* types.h:188:32 */
  718. // Type of miscellaneous file system fields.
  719. type X__fsword_t = int64 /* types.h:191:28 */
  720. type X__ssize_t = int64 /* types.h:193:27 */ // Type of a byte count, or error.
  721. // Signed long type used in system calls.
  722. type X__syscall_slong_t = int64 /* types.h:196:33 */
  723. // Unsigned long type used in system calls.
  724. type X__syscall_ulong_t = uint64 /* types.h:198:33 */
  725. // These few don't really vary by system, they always correspond
  726. //
  727. // to one of the other defined types.
  728. type X__loff_t = X__off64_t /* types.h:202:19 */ // Type of file sizes and offsets (LFS).
  729. type X__caddr_t = uintptr /* types.h:203:14 */
  730. // Duplicates info from stdint.h but this is used in unistd.h.
  731. type X__intptr_t = int64 /* types.h:206:25 */
  732. // Duplicate info from sys/socket.h.
  733. type X__socklen_t = uint32 /* types.h:209:23 */
  734. // C99: An integer type that can be accessed as an atomic entity,
  735. //
  736. // even in the presence of asynchronous interrupts.
  737. // It is not currently necessary for this to be machine-specific.
  738. type X__sig_atomic_t = int32 /* types.h:214:13 */
  739. // Seconds since the Epoch, visible to user code when time_t is too
  740. // narrow only for consistency with the old way of widening too-narrow
  741. // types. User code should never use __time64_t.
  742. // Get the definitions of O_*, F_*, FD_*: all the
  743. // numbers and flag bits for `open', `fcntl', et al.
  744. // O_*, F_*, FD_* bit values for Linux/x86.
  745. // Copyright (C) 2001-2020 Free Software Foundation, Inc.
  746. // This file is part of the GNU C Library.
  747. //
  748. // The GNU C Library is free software; you can redistribute it and/or
  749. // modify it under the terms of the GNU Lesser General Public
  750. // License as published by the Free Software Foundation; either
  751. // version 2.1 of the License, or (at your option) any later version.
  752. //
  753. // The GNU C Library is distributed in the hope that it will be useful,
  754. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  755. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  756. // Lesser General Public License for more details.
  757. //
  758. // You should have received a copy of the GNU Lesser General Public
  759. // License along with the GNU C Library; if not, see
  760. // <https://www.gnu.org/licenses/>.
  761. // Not necessary, we always have 64-bit offsets.
  762. type Flock = struct {
  763. Fl_type int16
  764. Fl_whence int16
  765. F__ccgo_pad1 [4]byte
  766. Fl_start X__off64_t
  767. Fl_len X__off64_t
  768. Fl_pid X__pid_t
  769. F__ccgo_pad2 [4]byte
  770. } /* fcntl.h:35:1 */
  771. // Include generic Linux declarations.
  772. // O_*, F_*, FD_* bit values for Linux.
  773. // Copyright (C) 2001-2020 Free Software Foundation, Inc.
  774. // This file is part of the GNU C Library.
  775. //
  776. // The GNU C Library is free software; you can redistribute it and/or
  777. // modify it under the terms of the GNU Lesser General Public
  778. // License as published by the Free Software Foundation; either
  779. // version 2.1 of the License, or (at your option) any later version.
  780. //
  781. // The GNU C Library is distributed in the hope that it will be useful,
  782. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  783. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  784. // Lesser General Public License for more details.
  785. //
  786. // You should have received a copy of the GNU Lesser General Public
  787. // License along with the GNU C Library; if not, see
  788. // <https://www.gnu.org/licenses/>.
  789. // This file contains shared definitions between Linux architectures
  790. // and is included by <bits/fcntl.h> to declare them. The various
  791. // #ifndef cases allow the architecture specific file to define those
  792. // values with different values.
  793. //
  794. // A minimal <bits/fcntl.h> contains just:
  795. //
  796. // struct flock {...}
  797. // #ifdef __USE_LARGEFILE64
  798. // struct flock64 {...}
  799. // #endif
  800. // #include <bits/fcntl-linux.h>
  801. // open/fcntl.
  802. // open file description locks.
  803. //
  804. // Usually record locks held by a process are released on *any* close and are
  805. // not inherited across a fork.
  806. //
  807. // These cmd values will set locks that conflict with process-associated record
  808. // locks, but are "owned" by the opened file description, not the process.
  809. // This means that they are inherited across fork or clone with CLONE_FILES
  810. // like BSD (flock) locks, and they are only released automatically when the
  811. // last reference to the the file description against which they were acquired
  812. // is put.
  813. // For now, Linux has no separate synchronicity options for read
  814. // operations. We define O_RSYNC therefore as the same as O_SYNC
  815. // since this is a superset.
  816. // Values for the second argument to `fcntl'.
  817. // For F_[GET|SET]FD.
  818. // For posix fcntl() and `l_type' field of a `struct flock' for lockf().
  819. // For old implementation of BSD flock.
  820. // Operations for BSD flock, also used by the kernel implementation.
  821. // Define some more compatibility macros to be backward compatible with
  822. // BSD systems which did not managed to hide these kernel macros.
  823. // Advise to `posix_fadvise'.
  824. // Values for `*at' functions.
  825. // Detect if open needs mode as a third argument (or for openat as a fourth
  826. // argument).
  827. // POSIX.1-2001 specifies that these types are defined by <fcntl.h>.
  828. //
  829. // Earlier POSIX standards permitted any type ending in `_t' to be defined
  830. // by any POSIX header, so we don't conditionalize the definitions here.
  831. type Mode_t = X__mode_t /* fcntl.h:50:18 */
  832. type Off_t = X__off64_t /* fcntl.h:58:19 */
  833. type Pid_t = X__pid_t /* fcntl.h:69:17 */
  834. // For XPG all symbols from <sys/stat.h> should also be available.
  835. // NB: Include guard matches what <linux/time.h> uses.
  836. // bits/types.h -- definitions of __*_t types underlying *_t types.
  837. // Copyright (C) 2002-2020 Free Software Foundation, Inc.
  838. // This file is part of the GNU C Library.
  839. //
  840. // The GNU C Library is free software; you can redistribute it and/or
  841. // modify it under the terms of the GNU Lesser General Public
  842. // License as published by the Free Software Foundation; either
  843. // version 2.1 of the License, or (at your option) any later version.
  844. //
  845. // The GNU C Library is distributed in the hope that it will be useful,
  846. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  847. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  848. // Lesser General Public License for more details.
  849. //
  850. // You should have received a copy of the GNU Lesser General Public
  851. // License along with the GNU C Library; if not, see
  852. // <https://www.gnu.org/licenses/>.
  853. // Never include this file directly; use <sys/types.h> instead.
  854. // Endian macros for string.h functions
  855. // Copyright (C) 1992-2020 Free Software Foundation, Inc.
  856. // This file is part of the GNU C Library.
  857. //
  858. // The GNU C Library is free software; you can redistribute it and/or
  859. // modify it under the terms of the GNU Lesser General Public
  860. // License as published by the Free Software Foundation; either
  861. // version 2.1 of the License, or (at your option) any later version.
  862. //
  863. // The GNU C Library is distributed in the hope that it will be useful,
  864. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  865. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  866. // Lesser General Public License for more details.
  867. //
  868. // You should have received a copy of the GNU Lesser General Public
  869. // License along with the GNU C Library; if not, see
  870. // <http://www.gnu.org/licenses/>.
  871. // Definitions for byte order, according to significance of bytes,
  872. // from low addresses to high addresses. The value is what you get by
  873. // putting '4' in the most significant byte, '3' in the second most
  874. // significant byte, '2' in the second least significant byte, and '1'
  875. // in the least significant byte, and then writing down one digit for
  876. // each byte, starting with the byte at the lowest address at the left,
  877. // and proceeding to the byte with the highest address at the right.
  878. // This file defines `__BYTE_ORDER' for the particular machine.
  879. // i386/x86_64 are little-endian.
  880. // Some machines may need to use a different endianness for floating point
  881. // values.
  882. // POSIX.1b structure for a time value. This is like a `struct timeval' but
  883. //
  884. // has nanoseconds instead of microseconds.
  885. type Timespec = struct {
  886. Ftv_sec X__time_t
  887. Ftv_nsec X__syscall_slong_t
  888. } /* struct_timespec.h:10:1 */
  889. // Copyright (C) 1999-2020 Free Software Foundation, Inc.
  890. // This file is part of the GNU C Library.
  891. //
  892. // The GNU C Library is free software; you can redistribute it and/or
  893. // modify it under the terms of the GNU Lesser General Public
  894. // License as published by the Free Software Foundation; either
  895. // version 2.1 of the License, or (at your option) any later version.
  896. //
  897. // The GNU C Library is distributed in the hope that it will be useful,
  898. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  899. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  900. // Lesser General Public License for more details.
  901. //
  902. // You should have received a copy of the GNU Lesser General Public
  903. // License along with the GNU C Library; if not, see
  904. // <https://www.gnu.org/licenses/>.
  905. // Versions of the `struct stat' data structure.
  906. // x86-64 versions of the `xmknod' interface.
  907. type Stat = struct {
  908. Fst_dev X__dev_t
  909. Fst_ino X__ino_t
  910. Fst_nlink X__nlink_t
  911. Fst_mode X__mode_t
  912. Fst_uid X__uid_t
  913. Fst_gid X__gid_t
  914. F__pad0 int32
  915. Fst_rdev X__dev_t
  916. Fst_size X__off_t
  917. Fst_blksize X__blksize_t
  918. Fst_blocks X__blkcnt_t
  919. Fst_atim struct {
  920. Ftv_sec X__time_t
  921. Ftv_nsec X__syscall_slong_t
  922. }
  923. Fst_mtim struct {
  924. Ftv_sec X__time_t
  925. Ftv_nsec X__syscall_slong_t
  926. }
  927. Fst_ctim struct {
  928. Ftv_sec X__time_t
  929. Ftv_nsec X__syscall_slong_t
  930. }
  931. F__glibc_reserved [3]X__syscall_slong_t
  932. } /* stat.h:46:1 */
  933. // Define some inlines helping to catch common problems.
  934. var _ int8 /* gen.c:2:13: */