fcntl_linux_loong64.go 61 KB

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