socket_linux_riscv64.go 78 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923
  1. // Code generated by 'ccgo sys/socket/gen.c -crt-import-path "" -export-defines "" -export-enums "" -export-externs X -export-fields F -export-structs "" -export-typedefs "" -header -hide _OSSwapInt16,_OSSwapInt32,_OSSwapInt64 -o sys/socket/socket_linux_riscv64.go -pkgname socket', DO NOT EDIT.
  2. package socket
  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. AF_ALG = 38
  15. AF_APPLETALK = 5
  16. AF_ASH = 18
  17. AF_ATMPVC = 8
  18. AF_ATMSVC = 20
  19. AF_AX25 = 3
  20. AF_BLUETOOTH = 31
  21. AF_BRIDGE = 7
  22. AF_CAIF = 37
  23. AF_CAN = 29
  24. AF_DECnet = 12
  25. AF_ECONET = 19
  26. AF_FILE = 1
  27. AF_IB = 27
  28. AF_IEEE802154 = 36
  29. AF_INET = 2
  30. AF_INET6 = 10
  31. AF_IPX = 4
  32. AF_IRDA = 23
  33. AF_ISDN = 34
  34. AF_IUCV = 32
  35. AF_KCM = 41
  36. AF_KEY = 15
  37. AF_LLC = 26
  38. AF_LOCAL = 1
  39. AF_MAX = 45
  40. AF_MPLS = 28
  41. AF_NETBEUI = 13
  42. AF_NETLINK = 16
  43. AF_NETROM = 6
  44. AF_NFC = 39
  45. AF_PACKET = 17
  46. AF_PHONET = 35
  47. AF_PPPOX = 24
  48. AF_QIPCRTR = 42
  49. AF_RDS = 21
  50. AF_ROSE = 11
  51. AF_ROUTE = 16
  52. AF_RXRPC = 33
  53. AF_SECURITY = 14
  54. AF_SMC = 43
  55. AF_SNA = 22
  56. AF_TIPC = 30
  57. AF_UNIX = 1
  58. AF_UNSPEC = 0
  59. AF_VSOCK = 40
  60. AF_WANPIPE = 25
  61. AF_X25 = 9
  62. AF_XDP = 44
  63. BIG_ENDIAN = 4321
  64. BYTE_ORDER = 1234
  65. FD_SETSIZE = 1024
  66. FIOGETOWN = 0x8903
  67. FIOSETOWN = 0x8901
  68. LITTLE_ENDIAN = 1234
  69. PDP_ENDIAN = 3412
  70. PF_ALG = 38
  71. PF_APPLETALK = 5
  72. PF_ASH = 18
  73. PF_ATMPVC = 8
  74. PF_ATMSVC = 20
  75. PF_AX25 = 3
  76. PF_BLUETOOTH = 31
  77. PF_BRIDGE = 7
  78. PF_CAIF = 37
  79. PF_CAN = 29
  80. PF_DECnet = 12
  81. PF_ECONET = 19
  82. PF_FILE = 1
  83. PF_IB = 27
  84. PF_IEEE802154 = 36
  85. PF_INET = 2
  86. PF_INET6 = 10
  87. PF_IPX = 4
  88. PF_IRDA = 23
  89. PF_ISDN = 34
  90. PF_IUCV = 32
  91. PF_KCM = 41
  92. PF_KEY = 15
  93. PF_LLC = 26
  94. PF_LOCAL = 1
  95. PF_MAX = 45
  96. PF_MPLS = 28
  97. PF_NETBEUI = 13
  98. PF_NETLINK = 16
  99. PF_NETROM = 6
  100. PF_NFC = 39
  101. PF_PACKET = 17
  102. PF_PHONET = 35
  103. PF_PPPOX = 24
  104. PF_QIPCRTR = 42
  105. PF_RDS = 21
  106. PF_ROSE = 11
  107. PF_ROUTE = 16
  108. PF_RXRPC = 33
  109. PF_SECURITY = 14
  110. PF_SMC = 43
  111. PF_SNA = 22
  112. PF_TIPC = 30
  113. PF_UNIX = 1
  114. PF_UNSPEC = 0
  115. PF_VSOCK = 40
  116. PF_WANPIPE = 25
  117. PF_X25 = 9
  118. PF_XDP = 44
  119. SCM_TIMESTAMP = 29
  120. SCM_TIMESTAMPING = 37
  121. SCM_TIMESTAMPING_OPT_STATS = 54
  122. SCM_TIMESTAMPING_PKTINFO = 58
  123. SCM_TIMESTAMPNS = 35
  124. SCM_TXTIME = 61
  125. SCM_WIFI_STATUS = 41
  126. SIOCATMARK = 0x8905
  127. SIOCGPGRP = 0x8904
  128. SIOCGSTAMPNS_OLD = 0x8907
  129. SIOCGSTAMP_OLD = 0x8906
  130. SIOCSPGRP = 0x8902
  131. SOL_AAL = 265
  132. SOL_ALG = 279
  133. SOL_ATM = 264
  134. SOL_BLUETOOTH = 274
  135. SOL_CAIF = 278
  136. SOL_DCCP = 269
  137. SOL_DECNET = 261
  138. SOL_IRDA = 266
  139. SOL_IUCV = 277
  140. SOL_KCM = 281
  141. SOL_LLC = 268
  142. SOL_NETBEUI = 267
  143. SOL_NETLINK = 270
  144. SOL_NFC = 280
  145. SOL_PACKET = 263
  146. SOL_PNPIPE = 275
  147. SOL_PPPOL2TP = 273
  148. SOL_RAW = 255
  149. SOL_RDS = 276
  150. SOL_RXRPC = 272
  151. SOL_SOCKET = 1
  152. SOL_TIPC = 271
  153. SOL_TLS = 282
  154. SOL_X25 = 262
  155. SOL_XDP = 283
  156. SOMAXCONN = 4096
  157. SO_ACCEPTCONN = 30
  158. SO_ATTACH_BPF = 50
  159. SO_ATTACH_FILTER = 26
  160. SO_ATTACH_REUSEPORT_CBPF = 51
  161. SO_ATTACH_REUSEPORT_EBPF = 52
  162. SO_BINDTODEVICE = 25
  163. SO_BINDTOIFINDEX = 62
  164. SO_BPF_EXTENSIONS = 48
  165. SO_BROADCAST = 6
  166. SO_BSDCOMPAT = 14
  167. SO_BUSY_POLL = 46
  168. SO_BUSY_POLL_BUDGET = 70
  169. SO_CNX_ADVICE = 53
  170. SO_COOKIE = 57
  171. SO_DEBUG = 1
  172. SO_DETACH_BPF = 27
  173. SO_DETACH_FILTER = 27
  174. SO_DETACH_REUSEPORT_BPF = 68
  175. SO_DOMAIN = 39
  176. SO_DONTROUTE = 5
  177. SO_ERROR = 4
  178. SO_GET_FILTER = 26
  179. SO_INCOMING_CPU = 49
  180. SO_INCOMING_NAPI_ID = 56
  181. SO_KEEPALIVE = 9
  182. SO_LINGER = 13
  183. SO_LOCK_FILTER = 44
  184. SO_MARK = 36
  185. SO_MAX_PACING_RATE = 47
  186. SO_MEMINFO = 55
  187. SO_NETNS_COOKIE = 71
  188. SO_NOFCS = 43
  189. SO_NO_CHECK = 11
  190. SO_OOBINLINE = 10
  191. SO_PASSCRED = 16
  192. SO_PASSSEC = 34
  193. SO_PEEK_OFF = 42
  194. SO_PEERCRED = 17
  195. SO_PEERGROUPS = 59
  196. SO_PEERNAME = 28
  197. SO_PEERSEC = 31
  198. SO_PREFER_BUSY_POLL = 69
  199. SO_PRIORITY = 12
  200. SO_PROTOCOL = 38
  201. SO_RCVBUF = 8
  202. SO_RCVBUFFORCE = 33
  203. SO_RCVLOWAT = 18
  204. SO_RCVTIMEO = 20
  205. SO_RCVTIMEO_NEW = 66
  206. SO_RCVTIMEO_OLD = 20
  207. SO_REUSEADDR = 2
  208. SO_REUSEPORT = 15
  209. SO_RXQ_OVFL = 40
  210. SO_SECURITY_AUTHENTICATION = 22
  211. SO_SECURITY_ENCRYPTION_NETWORK = 24
  212. SO_SECURITY_ENCRYPTION_TRANSPORT = 23
  213. SO_SELECT_ERR_QUEUE = 45
  214. SO_SNDBUF = 7
  215. SO_SNDBUFFORCE = 32
  216. SO_SNDLOWAT = 19
  217. SO_SNDTIMEO = 21
  218. SO_SNDTIMEO_NEW = 67
  219. SO_SNDTIMEO_OLD = 21
  220. SO_TIMESTAMP = 29
  221. SO_TIMESTAMPING = 37
  222. SO_TIMESTAMPING_NEW = 65
  223. SO_TIMESTAMPING_OLD = 37
  224. SO_TIMESTAMPNS = 35
  225. SO_TIMESTAMPNS_NEW = 64
  226. SO_TIMESTAMPNS_OLD = 35
  227. SO_TIMESTAMP_NEW = 63
  228. SO_TIMESTAMP_OLD = 29
  229. SO_TXTIME = 61
  230. SO_TYPE = 3
  231. SO_WIFI_STATUS = 41
  232. SO_ZEROCOPY = 60
  233. X_ASM_RISCV_BITSPERLONG_H = 0
  234. X_ATFILE_SOURCE = 1
  235. X_BITS_BYTESWAP_H = 1
  236. X_BITS_ENDIANNESS_H = 1
  237. X_BITS_ENDIAN_H = 1
  238. X_BITS_PTHREADTYPES_ARCH_H = 1
  239. X_BITS_PTHREADTYPES_COMMON_H = 1
  240. X_BITS_SOCKADDR_H = 1
  241. X_BITS_STDINT_INTN_H = 1
  242. X_BITS_TIME64_H = 1
  243. X_BITS_TYPESIZES_H = 1
  244. X_BITS_TYPES_H = 1
  245. X_BITS_UINTN_IDENTITY_H = 1
  246. X_BSD_SIZE_T_ = 0
  247. X_BSD_SIZE_T_DEFINED_ = 0
  248. X_DEFAULT_SOURCE = 1
  249. X_ENDIAN_H = 1
  250. X_FEATURES_H = 1
  251. X_FILE_OFFSET_BITS = 64
  252. X_GCC_SIZE_T = 0
  253. X_LINUX_POSIX_TYPES_H = 0
  254. X_LP64 = 1
  255. X_POSIX_C_SOURCE = 200809
  256. X_POSIX_SOURCE = 1
  257. X_RWLOCK_INTERNAL_H = 0
  258. X_SIZET_ = 0
  259. X_SIZE_T = 0
  260. X_SIZE_T_ = 0
  261. X_SIZE_T_DECLARED = 0
  262. X_SIZE_T_DEFINED = 0
  263. X_SIZE_T_DEFINED_ = 0
  264. X_SS_SIZE = 128
  265. X_STDC_PREDEF_H = 1
  266. X_STRUCT_TIMESPEC = 1
  267. X_SYS_CDEFS_H = 1
  268. X_SYS_SELECT_H = 1
  269. X_SYS_SIZE_T_H = 0
  270. X_SYS_SOCKET_H = 1
  271. X_SYS_TYPES_H = 1
  272. X_THREAD_MUTEX_INTERNAL_H = 1
  273. X_THREAD_SHARED_TYPES_H = 1
  274. X_T_SIZE = 0
  275. X_T_SIZE_ = 0
  276. Linux = 1
  277. Unix = 1
  278. )
  279. // Bits in the FLAGS argument to `send', `recv', et al.
  280. const ( /* socket.h:200:1: */
  281. MSG_OOB = 1 // Process out-of-band data.
  282. MSG_PEEK = 2 // Peek at incoming messages.
  283. MSG_DONTROUTE = 4 // Don't use local routing.
  284. MSG_CTRUNC = 8 // Control data lost before delivery.
  285. MSG_PROXY = 16 // Supply or ask second address.
  286. MSG_TRUNC = 32
  287. MSG_DONTWAIT = 64 // Nonblocking IO.
  288. MSG_EOR = 128 // End of record.
  289. MSG_WAITALL = 256 // Wait for a full request.
  290. MSG_FIN = 512
  291. MSG_SYN = 1024
  292. MSG_CONFIRM = 2048 // Confirm path validity.
  293. MSG_RST = 4096
  294. MSG_ERRQUEUE = 8192 // Fetch message from error queue.
  295. MSG_NOSIGNAL = 16384 // Do not generate SIGPIPE.
  296. MSG_MORE = 32768 // Sender will send more.
  297. MSG_WAITFORONE = 65536 // Wait for at least one packet to return.
  298. MSG_BATCH = 262144 // sendmmsg: more messages coming.
  299. MSG_ZEROCOPY = 67108864 // Use user data in kernel path.
  300. MSG_FASTOPEN = 536870912 // Send data in TCP SYN.
  301. MSG_CMSG_CLOEXEC = 1073741824
  302. )
  303. // Socket level message types. This must match the definitions in
  304. //
  305. // <linux/socket.h>.
  306. const ( /* socket.h:332:1: */
  307. SCM_RIGHTS = 1
  308. )
  309. // Get the architecture-dependent definition of enum __socket_type.
  310. // Define enum __socket_type for generic Linux.
  311. // Copyright (C) 1991-2021 Free Software Foundation, Inc.
  312. // This file is part of the GNU C Library.
  313. //
  314. // The GNU C Library is free software; you can redistribute it and/or
  315. // modify it under the terms of the GNU Lesser General Public
  316. // License as published by the Free Software Foundation; either
  317. // version 2.1 of the License, or (at your option) any later version.
  318. //
  319. // The GNU C Library is distributed in the hope that it will be useful,
  320. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  321. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  322. // Lesser General Public License for more details.
  323. //
  324. // You should have received a copy of the GNU Lesser General Public
  325. // License along with the GNU C Library; if not, see
  326. // <https://www.gnu.org/licenses/>.
  327. // Types of sockets.
  328. const ( /* socket_type.h:24:1: */
  329. SOCK_STREAM = 1 // Sequenced, reliable, connection-based
  330. // byte streams.
  331. SOCK_DGRAM = 2 // Connectionless, unreliable datagrams
  332. // of fixed maximum length.
  333. SOCK_RAW = 3 // Raw protocol interface.
  334. SOCK_RDM = 4 // Reliably-delivered messages.
  335. SOCK_SEQPACKET = 5 // Sequenced, reliable, connection-based,
  336. // datagrams of fixed maximum length.
  337. SOCK_DCCP = 6 // Datagram Congestion Control Protocol.
  338. SOCK_PACKET = 10 // Linux specific way of getting packets
  339. // at the dev level. For writing rarp and
  340. // other similar things on the user level.
  341. // Flags to be ORed into the type parameter of socket and socketpair and
  342. // used for the flags parameter of paccept.
  343. SOCK_CLOEXEC = 524288 // Atomically set close-on-exec flag for the
  344. // new descriptor(s).
  345. SOCK_NONBLOCK = 2048
  346. )
  347. // The following constants should be used for the second parameter of
  348. //
  349. // `shutdown'.
  350. const ( /* socket.h:41:1: */
  351. SHUT_RD = 0 // No more receptions.
  352. SHUT_WR = 1 // No more transmissions.
  353. SHUT_RDWR = 2
  354. )
  355. type Ptrdiff_t = int64 /* <builtin>:3:26 */
  356. type Size_t = uint64 /* <builtin>:9:23 */
  357. type Wchar_t = int32 /* <builtin>:15:24 */
  358. type X__int128_t = struct {
  359. Flo int64
  360. Fhi int64
  361. } /* <builtin>:21:43 */ // must match modernc.org/mathutil.Int128
  362. type X__uint128_t = struct {
  363. Flo uint64
  364. Fhi uint64
  365. } /* <builtin>:22:44 */ // must match modernc.org/mathutil.Int128
  366. type X__builtin_va_list = uintptr /* <builtin>:46:14 */
  367. type X__float128 = float64 /* <builtin>:47:21 */
  368. // Wide character type.
  369. // Locale-writers should change this as necessary to
  370. // be big enough to hold unique values not between 0 and 127,
  371. // and not (wchar_t) -1, for each defined multibyte character.
  372. // Define this type if we are doing the whole job,
  373. // or if we want this type in particular.
  374. // A null pointer constant.
  375. // Structure for scatter/gather I/O.
  376. type Iovec = struct {
  377. Fiov_base uintptr
  378. Fiov_len Size_t
  379. } /* struct_iovec.h:26:1 */
  380. // Copyright (C) 1989-2021 Free Software Foundation, Inc.
  381. //
  382. // This file is part of GCC.
  383. //
  384. // GCC is free software; you can redistribute it and/or modify
  385. // it under the terms of the GNU General Public License as published by
  386. // the Free Software Foundation; either version 3, or (at your option)
  387. // any later version.
  388. //
  389. // GCC is distributed in the hope that it will be useful,
  390. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  391. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  392. // GNU General Public License for more details.
  393. //
  394. // Under Section 7 of GPL version 3, you are granted additional
  395. // permissions described in the GCC Runtime Library Exception, version
  396. // 3.1, as published by the Free Software Foundation.
  397. //
  398. // You should have received a copy of the GNU General Public License and
  399. // a copy of the GCC Runtime Library Exception along with this program;
  400. // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  401. // <http://www.gnu.org/licenses/>.
  402. // ISO C Standard: 7.17 Common definitions <stddef.h>
  403. // Any one of these symbols __need_* means that GNU libc
  404. // wants us just to define one data type. So don't define
  405. // the symbols that indicate this file's entire job has been done.
  406. // This avoids lossage on SunOS but only if stdtypes.h comes first.
  407. // There's no way to win with the other order! Sun lossage.
  408. // Sequent's header files use _PTRDIFF_T_ in some conflicting way.
  409. // Just ignore it.
  410. // On VxWorks, <type/vxTypesBase.h> may have defined macros like
  411. // _TYPE_size_t which will typedef size_t. fixincludes patched the
  412. // vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
  413. // not defined, and so that defining this macro defines _GCC_SIZE_T.
  414. // If we find that the macros are still defined at this point, we must
  415. // invoke them so that the type is defined as expected.
  416. // In case nobody has defined these types, but we aren't running under
  417. // GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
  418. // __WCHAR_TYPE__ have reasonable values. This can happen if the
  419. // parts of GCC is compiled by an older compiler, that actually
  420. // include gstddef.h, such as collect2.
  421. // Signed type of difference of two pointers.
  422. // Define this type if we are doing the whole job,
  423. // or if we want this type in particular.
  424. // Unsigned type of `sizeof' something.
  425. // Define this type if we are doing the whole job,
  426. // or if we want this type in particular.
  427. // Wide character type.
  428. // Locale-writers should change this as necessary to
  429. // be big enough to hold unique values not between 0 and 127,
  430. // and not (wchar_t) -1, for each defined multibyte character.
  431. // Define this type if we are doing the whole job,
  432. // or if we want this type in particular.
  433. // A null pointer constant.
  434. // This operating system-specific header file defines the SOCK_*, PF_*,
  435. // AF_*, MSG_*, SOL_*, and SO_* constants, and the `struct sockaddr',
  436. // `struct msghdr', and `struct linger' types.
  437. // System-specific socket constants and types. Linux version.
  438. // Copyright (C) 1991-2021 Free Software Foundation, Inc.
  439. // This file is part of the GNU C Library.
  440. //
  441. // The GNU C Library is free software; you can redistribute it and/or
  442. // modify it under the terms of the GNU Lesser General Public
  443. // License as published by the Free Software Foundation; either
  444. // version 2.1 of the License, or (at your option) any later version.
  445. //
  446. // The GNU C Library is distributed in the hope that it will be useful,
  447. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  448. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  449. // Lesser General Public License for more details.
  450. //
  451. // You should have received a copy of the GNU Lesser General Public
  452. // License along with the GNU C Library; if not, see
  453. // <https://www.gnu.org/licenses/>.
  454. // Copyright (C) 1989-2021 Free Software Foundation, Inc.
  455. //
  456. // This file is part of GCC.
  457. //
  458. // GCC is free software; you can redistribute it and/or modify
  459. // it under the terms of the GNU General Public License as published by
  460. // the Free Software Foundation; either version 3, or (at your option)
  461. // any later version.
  462. //
  463. // GCC is distributed in the hope that it will be useful,
  464. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  465. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  466. // GNU General Public License for more details.
  467. //
  468. // Under Section 7 of GPL version 3, you are granted additional
  469. // permissions described in the GCC Runtime Library Exception, version
  470. // 3.1, as published by the Free Software Foundation.
  471. //
  472. // You should have received a copy of the GNU General Public License and
  473. // a copy of the GCC Runtime Library Exception along with this program;
  474. // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  475. // <http://www.gnu.org/licenses/>.
  476. // ISO C Standard: 7.17 Common definitions <stddef.h>
  477. // Any one of these symbols __need_* means that GNU libc
  478. // wants us just to define one data type. So don't define
  479. // the symbols that indicate this file's entire job has been done.
  480. // This avoids lossage on SunOS but only if stdtypes.h comes first.
  481. // There's no way to win with the other order! Sun lossage.
  482. // Sequent's header files use _PTRDIFF_T_ in some conflicting way.
  483. // Just ignore it.
  484. // On VxWorks, <type/vxTypesBase.h> may have defined macros like
  485. // _TYPE_size_t which will typedef size_t. fixincludes patched the
  486. // vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
  487. // not defined, and so that defining this macro defines _GCC_SIZE_T.
  488. // If we find that the macros are still defined at this point, we must
  489. // invoke them so that the type is defined as expected.
  490. // In case nobody has defined these types, but we aren't running under
  491. // GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
  492. // __WCHAR_TYPE__ have reasonable values. This can happen if the
  493. // parts of GCC is compiled by an older compiler, that actually
  494. // include gstddef.h, such as collect2.
  495. // Signed type of difference of two pointers.
  496. // Define this type if we are doing the whole job,
  497. // or if we want this type in particular.
  498. // Unsigned type of `sizeof' something.
  499. // Define this type if we are doing the whole job,
  500. // or if we want this type in particular.
  501. // Wide character type.
  502. // Locale-writers should change this as necessary to
  503. // be big enough to hold unique values not between 0 and 127,
  504. // and not (wchar_t) -1, for each defined multibyte character.
  505. // Define this type if we are doing the whole job,
  506. // or if we want this type in particular.
  507. // A null pointer constant.
  508. // Copyright (C) 1991-2021 Free Software Foundation, Inc.
  509. // This file is part of the GNU C Library.
  510. //
  511. // The GNU C Library is free software; you can redistribute it and/or
  512. // modify it under the terms of the GNU Lesser General Public
  513. // License as published by the Free Software Foundation; either
  514. // version 2.1 of the License, or (at your option) any later version.
  515. //
  516. // The GNU C Library is distributed in the hope that it will be useful,
  517. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  518. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  519. // Lesser General Public License for more details.
  520. //
  521. // You should have received a copy of the GNU Lesser General Public
  522. // License along with the GNU C Library; if not, see
  523. // <https://www.gnu.org/licenses/>.
  524. // POSIX Standard: 2.6 Primitive System Data Types <sys/types.h>
  525. // Copyright (C) 1991-2021 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. // bits/types.h -- definitions of __*_t types underlying *_t types.
  542. // Copyright (C) 2002-2021 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. // Never include this file directly; use <sys/types.h> instead.
  559. // Copyright (C) 1991-2021 Free Software Foundation, Inc.
  560. // This file is part of the GNU C Library.
  561. //
  562. // The GNU C Library is free software; you can redistribute it and/or
  563. // modify it under the terms of the GNU Lesser General Public
  564. // License as published by the Free Software Foundation; either
  565. // version 2.1 of the License, or (at your option) any later version.
  566. //
  567. // The GNU C Library is distributed in the hope that it will be useful,
  568. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  569. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  570. // Lesser General Public License for more details.
  571. //
  572. // You should have received a copy of the GNU Lesser General Public
  573. // License along with the GNU C Library; if not, see
  574. // <https://www.gnu.org/licenses/>.
  575. // Determine the wordsize from the preprocessor defines. RISC-V version.
  576. // Copyright (C) 2002-2021 Free Software Foundation, Inc.
  577. // This file is part of the GNU C Library.
  578. //
  579. // The GNU C Library is free software; you can redistribute it and/or
  580. // modify it under the terms of the GNU Lesser General Public
  581. // License as published by the Free Software Foundation; either
  582. // version 2.1 of the License, or (at your option) any later version.
  583. //
  584. // The GNU C Library is distributed in the hope that it will be useful,
  585. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  586. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  587. // Lesser General Public License for more details.
  588. //
  589. // You should have received a copy of the GNU Lesser General Public
  590. // License along with the GNU C Library. If not, see
  591. // <https://www.gnu.org/licenses/>.
  592. // Bit size of the time_t type at glibc build time, RISC-V case.
  593. // Copyright (C) 2020-2021 Free Software Foundation, Inc.
  594. // This file is part of the GNU C Library.
  595. //
  596. // The GNU C Library is free software; you can redistribute it and/or
  597. // modify it under the terms of the GNU Lesser General Public
  598. // License as published by the Free Software Foundation; either
  599. // version 2.1 of the License, or (at your option) any later version.
  600. //
  601. // The GNU C Library is distributed in the hope that it will be useful,
  602. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  603. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  604. // Lesser General Public License for more details.
  605. //
  606. // You should have received a copy of the GNU Lesser General Public
  607. // License along with the GNU C Library; if not, see
  608. // <https://www.gnu.org/licenses/>.
  609. // Determine the wordsize from the preprocessor defines. RISC-V version.
  610. // Copyright (C) 2002-2021 Free Software Foundation, Inc.
  611. // This file is part of the GNU C Library.
  612. //
  613. // The GNU C Library is free software; you can redistribute it and/or
  614. // modify it under the terms of the GNU Lesser General Public
  615. // License as published by the Free Software Foundation; either
  616. // version 2.1 of the License, or (at your option) any later version.
  617. //
  618. // The GNU C Library is distributed in the hope that it will be useful,
  619. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  620. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  621. // Lesser General Public License for more details.
  622. //
  623. // You should have received a copy of the GNU Lesser General Public
  624. // License along with the GNU C Library. If not, see
  625. // <https://www.gnu.org/licenses/>.
  626. // RV32 and RV64 both use 64-bit time_t
  627. // Convenience types.
  628. type X__u_char = uint8 /* types.h:31:23 */
  629. type X__u_short = uint16 /* types.h:32:28 */
  630. type X__u_int = uint32 /* types.h:33:22 */
  631. type X__u_long = uint64 /* types.h:34:27 */
  632. // Fixed-size types, underlying types depend on word size and compiler.
  633. type X__int8_t = int8 /* types.h:37:21 */
  634. type X__uint8_t = uint8 /* types.h:38:23 */
  635. type X__int16_t = int16 /* types.h:39:26 */
  636. type X__uint16_t = uint16 /* types.h:40:28 */
  637. type X__int32_t = int32 /* types.h:41:20 */
  638. type X__uint32_t = uint32 /* types.h:42:22 */
  639. type X__int64_t = int64 /* types.h:44:25 */
  640. type X__uint64_t = uint64 /* types.h:45:27 */
  641. // Smallest types with at least a given width.
  642. type X__int_least8_t = X__int8_t /* types.h:52:18 */
  643. type X__uint_least8_t = X__uint8_t /* types.h:53:19 */
  644. type X__int_least16_t = X__int16_t /* types.h:54:19 */
  645. type X__uint_least16_t = X__uint16_t /* types.h:55:20 */
  646. type X__int_least32_t = X__int32_t /* types.h:56:19 */
  647. type X__uint_least32_t = X__uint32_t /* types.h:57:20 */
  648. type X__int_least64_t = X__int64_t /* types.h:58:19 */
  649. type X__uint_least64_t = X__uint64_t /* types.h:59:20 */
  650. // quad_t is also 64 bits.
  651. type X__quad_t = int64 /* types.h:63:18 */
  652. type X__u_quad_t = uint64 /* types.h:64:27 */
  653. // Largest integral types.
  654. type X__intmax_t = int64 /* types.h:72:18 */
  655. type X__uintmax_t = uint64 /* types.h:73:27 */
  656. // The machine-dependent file <bits/typesizes.h> defines __*_T_TYPE
  657. // macros for each of the OS types we define below. The definitions
  658. // of those macros must use the following macros for underlying types.
  659. // We define __S<SIZE>_TYPE and __U<SIZE>_TYPE for the signed and unsigned
  660. // variants of each of the following integer types on this machine.
  661. //
  662. // 16 -- "natural" 16-bit type (always short)
  663. // 32 -- "natural" 32-bit type (always int)
  664. // 64 -- "natural" 64-bit type (long or long long)
  665. // LONG32 -- 32-bit type, traditionally long
  666. // QUAD -- 64-bit type, traditionally long long
  667. // WORD -- natural type of __WORDSIZE bits (int or long)
  668. // LONGWORD -- type of __WORDSIZE bits, traditionally long
  669. //
  670. // We distinguish WORD/LONGWORD, 32/LONG32, and 64/QUAD so that the
  671. // conventional uses of `long' or `long long' type modifiers match the
  672. // types we define, even when a less-adorned type would be the same size.
  673. // This matters for (somewhat) portably writing printf/scanf formats for
  674. // these types, where using the appropriate l or ll format modifiers can
  675. // make the typedefs and the formats match up across all GNU platforms. If
  676. // we used `long' when it's 64 bits where `long long' is expected, then the
  677. // compiler would warn about the formats not matching the argument types,
  678. // and the programmer changing them to shut up the compiler would break the
  679. // program's portability.
  680. //
  681. // Here we assume what is presently the case in all the GCC configurations
  682. // we support: long long is always 64 bits, long is always word/address size,
  683. // and int is always 32 bits.
  684. // No need to mark the typedef with __extension__.
  685. // bits/typesizes.h -- underlying types for *_t. For the generic Linux ABI.
  686. // Copyright (C) 2011-2021 Free Software Foundation, Inc.
  687. // This file is part of the GNU C Library.
  688. // Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
  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. // See <bits/types.h> for the meaning of these macros. This file exists so
  704. // that <bits/types.h> need not vary across different GNU platforms.
  705. // Tell the libc code that off_t and off64_t are actually the same type
  706. // for all ABI purposes, even if possibly expressed as different base types
  707. // for C type-checking purposes.
  708. // Same for ino_t and ino64_t.
  709. // And for __rlim_t and __rlim64_t.
  710. // And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t.
  711. // And for getitimer, setitimer and rusage
  712. // Number of descriptors that can fit in an `fd_set'.
  713. // bits/time64.h -- underlying types for __time64_t. RISC-V version.
  714. // Copyright (C) 2020-2021 Free Software Foundation, Inc.
  715. // This file is part of the GNU C Library.
  716. //
  717. // The GNU C Library is free software; you can redistribute it and/or
  718. // modify it under the terms of the GNU Lesser General Public
  719. // License as published by the Free Software Foundation; either
  720. // version 2.1 of the License, or (at your option) any later version.
  721. //
  722. // The GNU C Library is distributed in the hope that it will be useful,
  723. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  724. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  725. // Lesser General Public License for more details.
  726. //
  727. // You should have received a copy of the GNU Lesser General Public
  728. // License along with the GNU C Library; if not, see
  729. // <https://www.gnu.org/licenses/>.
  730. // Define __TIME64_T_TYPE so that it is always a 64-bit type.
  731. // If we already have 64-bit time type then use it.
  732. type X__dev_t = uint64 /* types.h:145:25 */ // Type of device numbers.
  733. type X__uid_t = uint32 /* types.h:146:25 */ // Type of user identifications.
  734. type X__gid_t = uint32 /* types.h:147:25 */ // Type of group identifications.
  735. type X__ino_t = uint64 /* types.h:148:25 */ // Type of file serial numbers.
  736. type X__ino64_t = uint64 /* types.h:149:27 */ // Type of file serial numbers (LFS).
  737. type X__mode_t = uint32 /* types.h:150:26 */ // Type of file attribute bitmasks.
  738. type X__nlink_t = uint32 /* types.h:151:27 */ // Type of file link counts.
  739. type X__off_t = int64 /* types.h:152:25 */ // Type of file sizes and offsets.
  740. type X__off64_t = int64 /* types.h:153:27 */ // Type of file sizes and offsets (LFS).
  741. type X__pid_t = int32 /* types.h:154:25 */ // Type of process identifications.
  742. type X__fsid_t = struct{ F__val [2]int32 } /* types.h:155:26 */ // Type of file system IDs.
  743. type X__clock_t = int64 /* types.h:156:27 */ // Type of CPU usage counts.
  744. type X__rlim_t = uint64 /* types.h:157:26 */ // Type for resource measurement.
  745. type X__rlim64_t = uint64 /* types.h:158:28 */ // Type for resource measurement (LFS).
  746. type X__id_t = uint32 /* types.h:159:24 */ // General type for IDs.
  747. type X__time_t = int64 /* types.h:160:26 */ // Seconds since the Epoch.
  748. type X__useconds_t = uint32 /* types.h:161:30 */ // Count of microseconds.
  749. type X__suseconds_t = int64 /* types.h:162:31 */ // Signed count of microseconds.
  750. type X__suseconds64_t = int64 /* types.h:163:33 */
  751. type X__daddr_t = int32 /* types.h:165:27 */ // The type of a disk address.
  752. type X__key_t = int32 /* types.h:166:25 */ // Type of an IPC key.
  753. // Clock ID used in clock and timer functions.
  754. type X__clockid_t = int32 /* types.h:169:29 */
  755. // Timer ID returned by `timer_create'.
  756. type X__timer_t = uintptr /* types.h:172:12 */
  757. // Type to represent block size.
  758. type X__blksize_t = int32 /* types.h:175:29 */
  759. // Types from the Large File Support interface.
  760. // Type to count number of disk blocks.
  761. type X__blkcnt_t = int64 /* types.h:180:28 */
  762. type X__blkcnt64_t = int64 /* types.h:181:30 */
  763. // Type to count file system blocks.
  764. type X__fsblkcnt_t = uint64 /* types.h:184:30 */
  765. type X__fsblkcnt64_t = uint64 /* types.h:185:32 */
  766. // Type to count file system nodes.
  767. type X__fsfilcnt_t = uint64 /* types.h:188:30 */
  768. type X__fsfilcnt64_t = uint64 /* types.h:189:32 */
  769. // Type of miscellaneous file system fields.
  770. type X__fsword_t = int64 /* types.h:192:28 */
  771. type X__ssize_t = int64 /* types.h:194:27 */ // Type of a byte count, or error.
  772. // Signed long type used in system calls.
  773. type X__syscall_slong_t = int64 /* types.h:197:33 */
  774. // Unsigned long type used in system calls.
  775. type X__syscall_ulong_t = uint64 /* types.h:199:33 */
  776. // These few don't really vary by system, they always correspond
  777. //
  778. // to one of the other defined types.
  779. type X__loff_t = X__off64_t /* types.h:203:19 */ // Type of file sizes and offsets (LFS).
  780. type X__caddr_t = uintptr /* types.h:204:14 */
  781. // Duplicates info from stdint.h but this is used in unistd.h.
  782. type X__intptr_t = int64 /* types.h:207:25 */
  783. // Duplicate info from sys/socket.h.
  784. type X__socklen_t = uint32 /* types.h:210:23 */
  785. // C99: An integer type that can be accessed as an atomic entity,
  786. //
  787. // even in the presence of asynchronous interrupts.
  788. // It is not currently necessary for this to be machine-specific.
  789. type X__sig_atomic_t = int32 /* types.h:215:13 */
  790. // Seconds since the Epoch, visible to user code when time_t is too
  791. // narrow only for consistency with the old way of widening too-narrow
  792. // types. User code should never use __time64_t.
  793. type U_char = X__u_char /* types.h:33:18 */
  794. type U_short = X__u_short /* types.h:34:19 */
  795. type U_int = X__u_int /* types.h:35:17 */
  796. type U_long = X__u_long /* types.h:36:18 */
  797. type Quad_t = X__quad_t /* types.h:37:18 */
  798. type U_quad_t = X__u_quad_t /* types.h:38:20 */
  799. type Fsid_t = X__fsid_t /* types.h:39:18 */
  800. type Loff_t = X__loff_t /* types.h:42:18 */
  801. type Ino_t = X__ino64_t /* types.h:49:19 */
  802. type Dev_t = X__dev_t /* types.h:59:17 */
  803. type Gid_t = X__gid_t /* types.h:64:17 */
  804. type Mode_t = X__mode_t /* types.h:69:18 */
  805. type Nlink_t = X__nlink_t /* types.h:74:19 */
  806. type Uid_t = X__uid_t /* types.h:79:17 */
  807. type Off_t = X__off64_t /* types.h:87:19 */
  808. type Pid_t = X__pid_t /* types.h:97:17 */
  809. type Id_t = X__id_t /* types.h:103:16 */
  810. type Ssize_t = X__ssize_t /* types.h:108:19 */
  811. type Daddr_t = X__daddr_t /* types.h:114:19 */
  812. type Caddr_t = X__caddr_t /* types.h:115:19 */
  813. type Key_t = X__key_t /* types.h:121:17 */
  814. // bits/types.h -- definitions of __*_t types underlying *_t types.
  815. // Copyright (C) 2002-2021 Free Software Foundation, Inc.
  816. // This file is part of the GNU C Library.
  817. //
  818. // The GNU C Library is free software; you can redistribute it and/or
  819. // modify it under the terms of the GNU Lesser General Public
  820. // License as published by the Free Software Foundation; either
  821. // version 2.1 of the License, or (at your option) any later version.
  822. //
  823. // The GNU C Library is distributed in the hope that it will be useful,
  824. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  825. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  826. // Lesser General Public License for more details.
  827. //
  828. // You should have received a copy of the GNU Lesser General Public
  829. // License along with the GNU C Library; if not, see
  830. // <https://www.gnu.org/licenses/>.
  831. // Never include this file directly; use <sys/types.h> instead.
  832. // Returned by `clock'.
  833. type Clock_t = X__clock_t /* clock_t.h:7:19 */
  834. // bits/types.h -- definitions of __*_t types underlying *_t types.
  835. // Copyright (C) 2002-2021 Free Software Foundation, Inc.
  836. // This file is part of the GNU C Library.
  837. //
  838. // The GNU C Library is free software; you can redistribute it and/or
  839. // modify it under the terms of the GNU Lesser General Public
  840. // License as published by the Free Software Foundation; either
  841. // version 2.1 of the License, or (at your option) any later version.
  842. //
  843. // The GNU C Library is distributed in the hope that it will be useful,
  844. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  845. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  846. // Lesser General Public License for more details.
  847. //
  848. // You should have received a copy of the GNU Lesser General Public
  849. // License along with the GNU C Library; if not, see
  850. // <https://www.gnu.org/licenses/>.
  851. // Never include this file directly; use <sys/types.h> instead.
  852. // Clock ID used in clock and timer functions.
  853. type Clockid_t = X__clockid_t /* clockid_t.h:7:21 */
  854. // bits/types.h -- definitions of __*_t types underlying *_t types.
  855. // Copyright (C) 2002-2021 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. // <https://www.gnu.org/licenses/>.
  871. // Never include this file directly; use <sys/types.h> instead.
  872. // Returned by `time'.
  873. type Time_t = X__time_t /* time_t.h:10:18 */
  874. // bits/types.h -- definitions of __*_t types underlying *_t types.
  875. // Copyright (C) 2002-2021 Free Software Foundation, Inc.
  876. // This file is part of the GNU C Library.
  877. //
  878. // The GNU C Library is free software; you can redistribute it and/or
  879. // modify it under the terms of the GNU Lesser General Public
  880. // License as published by the Free Software Foundation; either
  881. // version 2.1 of the License, or (at your option) any later version.
  882. //
  883. // The GNU C Library is distributed in the hope that it will be useful,
  884. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  885. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  886. // Lesser General Public License for more details.
  887. //
  888. // You should have received a copy of the GNU Lesser General Public
  889. // License along with the GNU C Library; if not, see
  890. // <https://www.gnu.org/licenses/>.
  891. // Never include this file directly; use <sys/types.h> instead.
  892. // Timer ID returned by `timer_create'.
  893. type Timer_t = X__timer_t /* timer_t.h:7:19 */
  894. // Copyright (C) 1989-2021 Free Software Foundation, Inc.
  895. //
  896. // This file is part of GCC.
  897. //
  898. // GCC is free software; you can redistribute it and/or modify
  899. // it under the terms of the GNU General Public License as published by
  900. // the Free Software Foundation; either version 3, or (at your option)
  901. // any later version.
  902. //
  903. // GCC is distributed in the hope that it will be useful,
  904. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  905. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  906. // GNU General Public License for more details.
  907. //
  908. // Under Section 7 of GPL version 3, you are granted additional
  909. // permissions described in the GCC Runtime Library Exception, version
  910. // 3.1, as published by the Free Software Foundation.
  911. //
  912. // You should have received a copy of the GNU General Public License and
  913. // a copy of the GCC Runtime Library Exception along with this program;
  914. // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  915. // <http://www.gnu.org/licenses/>.
  916. // ISO C Standard: 7.17 Common definitions <stddef.h>
  917. // Any one of these symbols __need_* means that GNU libc
  918. // wants us just to define one data type. So don't define
  919. // the symbols that indicate this file's entire job has been done.
  920. // This avoids lossage on SunOS but only if stdtypes.h comes first.
  921. // There's no way to win with the other order! Sun lossage.
  922. // Sequent's header files use _PTRDIFF_T_ in some conflicting way.
  923. // Just ignore it.
  924. // On VxWorks, <type/vxTypesBase.h> may have defined macros like
  925. // _TYPE_size_t which will typedef size_t. fixincludes patched the
  926. // vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
  927. // not defined, and so that defining this macro defines _GCC_SIZE_T.
  928. // If we find that the macros are still defined at this point, we must
  929. // invoke them so that the type is defined as expected.
  930. // In case nobody has defined these types, but we aren't running under
  931. // GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
  932. // __WCHAR_TYPE__ have reasonable values. This can happen if the
  933. // parts of GCC is compiled by an older compiler, that actually
  934. // include gstddef.h, such as collect2.
  935. // Signed type of difference of two pointers.
  936. // Define this type if we are doing the whole job,
  937. // or if we want this type in particular.
  938. // Unsigned type of `sizeof' something.
  939. // Define this type if we are doing the whole job,
  940. // or if we want this type in particular.
  941. // Wide character type.
  942. // Locale-writers should change this as necessary to
  943. // be big enough to hold unique values not between 0 and 127,
  944. // and not (wchar_t) -1, for each defined multibyte character.
  945. // Define this type if we are doing the whole job,
  946. // or if we want this type in particular.
  947. // A null pointer constant.
  948. // Old compatibility names for C types.
  949. type Ulong = uint64 /* types.h:148:27 */
  950. type Ushort = uint16 /* types.h:149:28 */
  951. type Uint = uint32 /* types.h:150:22 */
  952. // These size-specific names are used by some of the inet code.
  953. // Define intN_t types.
  954. // Copyright (C) 2017-2021 Free Software Foundation, Inc.
  955. // This file is part of the GNU C Library.
  956. //
  957. // The GNU C Library is free software; you can redistribute it and/or
  958. // modify it under the terms of the GNU Lesser General Public
  959. // License as published by the Free Software Foundation; either
  960. // version 2.1 of the License, or (at your option) any later version.
  961. //
  962. // The GNU C Library is distributed in the hope that it will be useful,
  963. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  964. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  965. // Lesser General Public License for more details.
  966. //
  967. // You should have received a copy of the GNU Lesser General Public
  968. // License along with the GNU C Library; if not, see
  969. // <https://www.gnu.org/licenses/>.
  970. // bits/types.h -- definitions of __*_t types underlying *_t types.
  971. // Copyright (C) 2002-2021 Free Software Foundation, Inc.
  972. // This file is part of the GNU C Library.
  973. //
  974. // The GNU C Library is free software; you can redistribute it and/or
  975. // modify it under the terms of the GNU Lesser General Public
  976. // License as published by the Free Software Foundation; either
  977. // version 2.1 of the License, or (at your option) any later version.
  978. //
  979. // The GNU C Library is distributed in the hope that it will be useful,
  980. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  981. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  982. // Lesser General Public License for more details.
  983. //
  984. // You should have received a copy of the GNU Lesser General Public
  985. // License along with the GNU C Library; if not, see
  986. // <https://www.gnu.org/licenses/>.
  987. // Never include this file directly; use <sys/types.h> instead.
  988. type Int8_t = X__int8_t /* stdint-intn.h:24:18 */
  989. type Int16_t = X__int16_t /* stdint-intn.h:25:19 */
  990. type Int32_t = X__int32_t /* stdint-intn.h:26:19 */
  991. type Int64_t = X__int64_t /* stdint-intn.h:27:19 */
  992. // These were defined by ISO C without the first `_'.
  993. type U_int8_t = X__uint8_t /* types.h:158:19 */
  994. type U_int16_t = X__uint16_t /* types.h:159:20 */
  995. type U_int32_t = X__uint32_t /* types.h:160:20 */
  996. type U_int64_t = X__uint64_t /* types.h:161:20 */
  997. type Register_t = int32 /* types.h:164:13 */
  998. // It also defines `fd_set' and the FD_* macros for `select'.
  999. // `fd_set' type and related macros, and `select'/`pselect' declarations.
  1000. // Copyright (C) 1996-2021 Free Software Foundation, Inc.
  1001. // This file is part of the GNU C Library.
  1002. //
  1003. // The GNU C Library is free software; you can redistribute it and/or
  1004. // modify it under the terms of the GNU Lesser General Public
  1005. // License as published by the Free Software Foundation; either
  1006. // version 2.1 of the License, or (at your option) any later version.
  1007. //
  1008. // The GNU C Library is distributed in the hope that it will be useful,
  1009. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  1010. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1011. // Lesser General Public License for more details.
  1012. //
  1013. // You should have received a copy of the GNU Lesser General Public
  1014. // License along with the GNU C Library; if not, see
  1015. // <https://www.gnu.org/licenses/>.
  1016. // POSIX 1003.1g: 6.2 Select from File Descriptor Sets <sys/select.h>
  1017. // Copyright (C) 1991-2021 Free Software Foundation, Inc.
  1018. // This file is part of the GNU C Library.
  1019. //
  1020. // The GNU C Library is free software; you can redistribute it and/or
  1021. // modify it under the terms of the GNU Lesser General Public
  1022. // License as published by the Free Software Foundation; either
  1023. // version 2.1 of the License, or (at your option) any later version.
  1024. //
  1025. // The GNU C Library is distributed in the hope that it will be useful,
  1026. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  1027. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1028. // Lesser General Public License for more details.
  1029. //
  1030. // You should have received a copy of the GNU Lesser General Public
  1031. // License along with the GNU C Library; if not, see
  1032. // <https://www.gnu.org/licenses/>.
  1033. // Get definition of needed basic types.
  1034. // bits/types.h -- definitions of __*_t types underlying *_t types.
  1035. // Copyright (C) 2002-2021 Free Software Foundation, Inc.
  1036. // This file is part of the GNU C Library.
  1037. //
  1038. // The GNU C Library is free software; you can redistribute it and/or
  1039. // modify it under the terms of the GNU Lesser General Public
  1040. // License as published by the Free Software Foundation; either
  1041. // version 2.1 of the License, or (at your option) any later version.
  1042. //
  1043. // The GNU C Library is distributed in the hope that it will be useful,
  1044. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  1045. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1046. // Lesser General Public License for more details.
  1047. //
  1048. // You should have received a copy of the GNU Lesser General Public
  1049. // License along with the GNU C Library; if not, see
  1050. // <https://www.gnu.org/licenses/>.
  1051. // Never include this file directly; use <sys/types.h> instead.
  1052. // Get __FD_* definitions.
  1053. // Copyright (C) 1997-2021 Free Software Foundation, Inc.
  1054. // This file is part of the GNU C Library.
  1055. //
  1056. // The GNU C Library is free software; you can redistribute it and/or
  1057. // modify it under the terms of the GNU Lesser General Public
  1058. // License as published by the Free Software Foundation; either
  1059. // version 2.1 of the License, or (at your option) any later version.
  1060. //
  1061. // The GNU C Library is distributed in the hope that it will be useful,
  1062. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  1063. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1064. // Lesser General Public License for more details.
  1065. //
  1066. // You should have received a copy of the GNU Lesser General Public
  1067. // License along with the GNU C Library; if not, see
  1068. // <https://www.gnu.org/licenses/>.
  1069. // We don't use `memset' because this would require a prototype and
  1070. // the array isn't too big.
  1071. // Get sigset_t.
  1072. type X__sigset_t = struct{ F__val [16]uint64 } /* __sigset_t.h:8:3 */
  1073. // A set of signals to be blocked, unblocked, or waited for.
  1074. type Sigset_t = X__sigset_t /* sigset_t.h:7:20 */
  1075. // Get definition of timer specification structures.
  1076. // bits/types.h -- definitions of __*_t types underlying *_t types.
  1077. // Copyright (C) 2002-2021 Free Software Foundation, Inc.
  1078. // This file is part of the GNU C Library.
  1079. //
  1080. // The GNU C Library is free software; you can redistribute it and/or
  1081. // modify it under the terms of the GNU Lesser General Public
  1082. // License as published by the Free Software Foundation; either
  1083. // version 2.1 of the License, or (at your option) any later version.
  1084. //
  1085. // The GNU C Library is distributed in the hope that it will be useful,
  1086. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  1087. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1088. // Lesser General Public License for more details.
  1089. //
  1090. // You should have received a copy of the GNU Lesser General Public
  1091. // License along with the GNU C Library; if not, see
  1092. // <https://www.gnu.org/licenses/>.
  1093. // Never include this file directly; use <sys/types.h> instead.
  1094. // A time value that is accurate to the nearest
  1095. //
  1096. // microsecond but also has a range of years.
  1097. type Timeval = struct {
  1098. Ftv_sec X__time_t
  1099. Ftv_usec X__suseconds_t
  1100. } /* struct_timeval.h:8:1 */
  1101. // NB: Include guard matches what <linux/time.h> uses.
  1102. // bits/types.h -- definitions of __*_t types underlying *_t types.
  1103. // Copyright (C) 2002-2021 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. // <https://www.gnu.org/licenses/>.
  1119. // Never include this file directly; use <sys/types.h> instead.
  1120. // Endian macros for string.h functions
  1121. // Copyright (C) 1992-2021 Free Software Foundation, Inc.
  1122. // This file is part of the GNU C Library.
  1123. //
  1124. // The GNU C Library is free software; you can redistribute it and/or
  1125. // modify it under the terms of the GNU Lesser General Public
  1126. // License as published by the Free Software Foundation; either
  1127. // version 2.1 of the License, or (at your option) any later version.
  1128. //
  1129. // The GNU C Library is distributed in the hope that it will be useful,
  1130. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  1131. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1132. // Lesser General Public License for more details.
  1133. //
  1134. // You should have received a copy of the GNU Lesser General Public
  1135. // License along with the GNU C Library; if not, see
  1136. // <http://www.gnu.org/licenses/>.
  1137. // POSIX.1b structure for a time value. This is like a `struct timeval' but
  1138. //
  1139. // has nanoseconds instead of microseconds.
  1140. type Timespec = struct {
  1141. Ftv_sec X__time_t
  1142. Ftv_nsec X__syscall_slong_t
  1143. } /* struct_timespec.h:11:1 */
  1144. type Suseconds_t = X__suseconds_t /* select.h:43:23 */
  1145. // The fd_set member is required to be an array of longs.
  1146. type X__fd_mask = int64 /* select.h:49:18 */
  1147. // Some versions of <linux/posix_types.h> define this macros.
  1148. // It's easier to assume 8-bit bytes than to get CHAR_BIT.
  1149. // fd_set for select and pselect.
  1150. type Fd_set = struct{ F__fds_bits [16]X__fd_mask } /* select.h:70:5 */
  1151. // Maximum number of file descriptors in `fd_set'.
  1152. // Sometimes the fd_set member is assumed to have this type.
  1153. type Fd_mask = X__fd_mask /* select.h:77:19 */
  1154. // Define some inlines helping to catch common problems.
  1155. type Blksize_t = X__blksize_t /* types.h:185:21 */
  1156. // Types from the Large File Support interface.
  1157. type Blkcnt_t = X__blkcnt64_t /* types.h:205:22 */ // Type to count number of disk blocks.
  1158. type Fsblkcnt_t = X__fsblkcnt64_t /* types.h:209:24 */ // Type to count file system blocks.
  1159. type Fsfilcnt_t = X__fsfilcnt64_t /* types.h:213:24 */ // Type to count file system inodes.
  1160. // Now add the thread types.
  1161. // Declaration of common pthread types for all architectures.
  1162. // Copyright (C) 2017-2021 Free Software Foundation, Inc.
  1163. // This file is part of the GNU C Library.
  1164. //
  1165. // The GNU C Library is free software; you can redistribute it and/or
  1166. // modify it under the terms of the GNU Lesser General Public
  1167. // License as published by the Free Software Foundation; either
  1168. // version 2.1 of the License, or (at your option) any later version.
  1169. //
  1170. // The GNU C Library is distributed in the hope that it will be useful,
  1171. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  1172. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1173. // Lesser General Public License for more details.
  1174. //
  1175. // You should have received a copy of the GNU Lesser General Public
  1176. // License along with the GNU C Library; if not, see
  1177. // <https://www.gnu.org/licenses/>.
  1178. // For internal mutex and condition variable definitions.
  1179. // Common threading primitives definitions for both POSIX and C11.
  1180. // Copyright (C) 2017-2021 Free Software Foundation, Inc.
  1181. // This file is part of the GNU C Library.
  1182. //
  1183. // The GNU C Library is free software; you can redistribute it and/or
  1184. // modify it under the terms of the GNU Lesser General Public
  1185. // License as published by the Free Software Foundation; either
  1186. // version 2.1 of the License, or (at your option) any later version.
  1187. //
  1188. // The GNU C Library is distributed in the hope that it will be useful,
  1189. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  1190. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1191. // Lesser General Public License for more details.
  1192. //
  1193. // You should have received a copy of the GNU Lesser General Public
  1194. // License along with the GNU C Library; if not, see
  1195. // <https://www.gnu.org/licenses/>.
  1196. // Arch-specific definitions. Each architecture must define the following
  1197. // macros to define the expected sizes of pthread data types:
  1198. //
  1199. // __SIZEOF_PTHREAD_ATTR_T - size of pthread_attr_t.
  1200. // __SIZEOF_PTHREAD_MUTEX_T - size of pthread_mutex_t.
  1201. // __SIZEOF_PTHREAD_MUTEXATTR_T - size of pthread_mutexattr_t.
  1202. // __SIZEOF_PTHREAD_COND_T - size of pthread_cond_t.
  1203. // __SIZEOF_PTHREAD_CONDATTR_T - size of pthread_condattr_t.
  1204. // __SIZEOF_PTHREAD_RWLOCK_T - size of pthread_rwlock_t.
  1205. // __SIZEOF_PTHREAD_RWLOCKATTR_T - size of pthread_rwlockattr_t.
  1206. // __SIZEOF_PTHREAD_BARRIER_T - size of pthread_barrier_t.
  1207. // __SIZEOF_PTHREAD_BARRIERATTR_T - size of pthread_barrierattr_t.
  1208. //
  1209. // The additional macro defines any constraint for the lock alignment
  1210. // inside the thread structures:
  1211. //
  1212. // __LOCK_ALIGNMENT - for internal lock/futex usage.
  1213. //
  1214. // Same idea but for the once locking primitive:
  1215. //
  1216. // __ONCE_ALIGNMENT - for pthread_once_t/once_flag definition.
  1217. // Machine-specific pthread type layouts. RISC-V version.
  1218. // Copyright (C) 2011-2021 Free Software Foundation, Inc.
  1219. // This file is part of the GNU C Library.
  1220. //
  1221. // The GNU C Library is free software; you can redistribute it and/or
  1222. // modify it under the terms of the GNU Lesser General Public
  1223. // License as published by the Free Software Foundation; either
  1224. // version 2.1 of the License, or (at your option) any later version.
  1225. //
  1226. // The GNU C Library is distributed in the hope that it will be useful,
  1227. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  1228. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1229. // Lesser General Public License for more details.
  1230. //
  1231. // You should have received a copy of the GNU Lesser General Public
  1232. // License along with the GNU C Library. If not, see
  1233. // <https://www.gnu.org/licenses/>.
  1234. // Endian macros for string.h functions
  1235. // Copyright (C) 1992-2021 Free Software Foundation, Inc.
  1236. // This file is part of the GNU C Library.
  1237. //
  1238. // The GNU C Library is free software; you can redistribute it and/or
  1239. // modify it under the terms of the GNU Lesser General Public
  1240. // License as published by the Free Software Foundation; either
  1241. // version 2.1 of the License, or (at your option) any later version.
  1242. //
  1243. // The GNU C Library is distributed in the hope that it will be useful,
  1244. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  1245. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1246. // Lesser General Public License for more details.
  1247. //
  1248. // You should have received a copy of the GNU Lesser General Public
  1249. // License along with the GNU C Library; if not, see
  1250. // <http://www.gnu.org/licenses/>.
  1251. // Common definition of pthread_mutex_t.
  1252. type X__pthread_internal_list = struct {
  1253. F__prev uintptr
  1254. F__next uintptr
  1255. } /* thread-shared-types.h:49:9 */
  1256. // Type to count file system inodes.
  1257. // Now add the thread types.
  1258. // Declaration of common pthread types for all architectures.
  1259. // Copyright (C) 2017-2021 Free Software Foundation, Inc.
  1260. // This file is part of the GNU C Library.
  1261. //
  1262. // The GNU C Library is free software; you can redistribute it and/or
  1263. // modify it under the terms of the GNU Lesser General Public
  1264. // License as published by the Free Software Foundation; either
  1265. // version 2.1 of the License, or (at your option) any later version.
  1266. //
  1267. // The GNU C Library is distributed in the hope that it will be useful,
  1268. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  1269. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1270. // Lesser General Public License for more details.
  1271. //
  1272. // You should have received a copy of the GNU Lesser General Public
  1273. // License along with the GNU C Library; if not, see
  1274. // <https://www.gnu.org/licenses/>.
  1275. // For internal mutex and condition variable definitions.
  1276. // Common threading primitives definitions for both POSIX and C11.
  1277. // Copyright (C) 2017-2021 Free Software Foundation, Inc.
  1278. // This file is part of the GNU C Library.
  1279. //
  1280. // The GNU C Library is free software; you can redistribute it and/or
  1281. // modify it under the terms of the GNU Lesser General Public
  1282. // License as published by the Free Software Foundation; either
  1283. // version 2.1 of the License, or (at your option) any later version.
  1284. //
  1285. // The GNU C Library is distributed in the hope that it will be useful,
  1286. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  1287. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1288. // Lesser General Public License for more details.
  1289. //
  1290. // You should have received a copy of the GNU Lesser General Public
  1291. // License along with the GNU C Library; if not, see
  1292. // <https://www.gnu.org/licenses/>.
  1293. // Arch-specific definitions. Each architecture must define the following
  1294. // macros to define the expected sizes of pthread data types:
  1295. //
  1296. // __SIZEOF_PTHREAD_ATTR_T - size of pthread_attr_t.
  1297. // __SIZEOF_PTHREAD_MUTEX_T - size of pthread_mutex_t.
  1298. // __SIZEOF_PTHREAD_MUTEXATTR_T - size of pthread_mutexattr_t.
  1299. // __SIZEOF_PTHREAD_COND_T - size of pthread_cond_t.
  1300. // __SIZEOF_PTHREAD_CONDATTR_T - size of pthread_condattr_t.
  1301. // __SIZEOF_PTHREAD_RWLOCK_T - size of pthread_rwlock_t.
  1302. // __SIZEOF_PTHREAD_RWLOCKATTR_T - size of pthread_rwlockattr_t.
  1303. // __SIZEOF_PTHREAD_BARRIER_T - size of pthread_barrier_t.
  1304. // __SIZEOF_PTHREAD_BARRIERATTR_T - size of pthread_barrierattr_t.
  1305. //
  1306. // The additional macro defines any constraint for the lock alignment
  1307. // inside the thread structures:
  1308. //
  1309. // __LOCK_ALIGNMENT - for internal lock/futex usage.
  1310. //
  1311. // Same idea but for the once locking primitive:
  1312. //
  1313. // __ONCE_ALIGNMENT - for pthread_once_t/once_flag definition.
  1314. // Machine-specific pthread type layouts. RISC-V version.
  1315. // Copyright (C) 2011-2021 Free Software Foundation, Inc.
  1316. // This file is part of the GNU C Library.
  1317. //
  1318. // The GNU C Library is free software; you can redistribute it and/or
  1319. // modify it under the terms of the GNU Lesser General Public
  1320. // License as published by the Free Software Foundation; either
  1321. // version 2.1 of the License, or (at your option) any later version.
  1322. //
  1323. // The GNU C Library is distributed in the hope that it will be useful,
  1324. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  1325. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1326. // Lesser General Public License for more details.
  1327. //
  1328. // You should have received a copy of the GNU Lesser General Public
  1329. // License along with the GNU C Library. If not, see
  1330. // <https://www.gnu.org/licenses/>.
  1331. // Endian macros for string.h functions
  1332. // Copyright (C) 1992-2021 Free Software Foundation, Inc.
  1333. // This file is part of the GNU C Library.
  1334. //
  1335. // The GNU C Library is free software; you can redistribute it and/or
  1336. // modify it under the terms of the GNU Lesser General Public
  1337. // License as published by the Free Software Foundation; either
  1338. // version 2.1 of the License, or (at your option) any later version.
  1339. //
  1340. // The GNU C Library is distributed in the hope that it will be useful,
  1341. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  1342. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1343. // Lesser General Public License for more details.
  1344. //
  1345. // You should have received a copy of the GNU Lesser General Public
  1346. // License along with the GNU C Library; if not, see
  1347. // <http://www.gnu.org/licenses/>.
  1348. // Common definition of pthread_mutex_t.
  1349. type X__pthread_list_t = X__pthread_internal_list /* thread-shared-types.h:53:3 */
  1350. type X__pthread_internal_slist = struct{ F__next uintptr } /* thread-shared-types.h:55:9 */
  1351. type X__pthread_slist_t = X__pthread_internal_slist /* thread-shared-types.h:58:3 */
  1352. // Arch-specific mutex definitions. A generic implementation is provided
  1353. // by sysdeps/nptl/bits/struct_mutex.h. If required, an architecture
  1354. // can override it by defining:
  1355. //
  1356. // 1. struct __pthread_mutex_s (used on both pthread_mutex_t and mtx_t
  1357. // definition). It should contains at least the internal members
  1358. // defined in the generic version.
  1359. //
  1360. // 2. __LOCK_ALIGNMENT for any extra attribute for internal lock used with
  1361. // atomic operations.
  1362. //
  1363. // 3. The macro __PTHREAD_MUTEX_INITIALIZER used for static initialization.
  1364. // It should initialize the mutex internal flag.
  1365. // Default mutex implementation struct definitions.
  1366. // Copyright (C) 2019-2021 Free Software Foundation, Inc.
  1367. // This file is part of the GNU C Library.
  1368. //
  1369. // The GNU C Library is free software; you can redistribute it and/or
  1370. // modify it under the terms of the GNU Lesser General Public
  1371. // License as published by the Free Software Foundation; either
  1372. // version 2.1 of the License, or (at your option) any later version.
  1373. //
  1374. // The GNU C Library is distributed in the hope that it will be useful,
  1375. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  1376. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1377. // Lesser General Public License for more details.
  1378. //
  1379. // You should have received a copy of the GNU Lesser General Public
  1380. // License along with the GNU C Library; if not, see
  1381. // <http://www.gnu.org/licenses/>.
  1382. // Generic struct for both POSIX and C11 mutexes. New ports are expected
  1383. // to use the default layout, however architecture can redefine it to
  1384. // add arch-specific extension (such as lock-elision). The struct have
  1385. // a size of 32 bytes on LP32 and 40 bytes on LP64 architectures.
  1386. type X__pthread_mutex_s = struct {
  1387. F__lock int32
  1388. F__count uint32
  1389. F__owner int32
  1390. F__nusers uint32
  1391. F__kind int32
  1392. F__spins int32
  1393. F__list X__pthread_list_t
  1394. } /* struct_mutex.h:27:1 */
  1395. // Arch-sepecific read-write lock definitions. A generic implementation is
  1396. // provided by struct_rwlock.h. If required, an architecture can override it
  1397. // by defining:
  1398. //
  1399. // 1. struct __pthread_rwlock_arch_t (used on pthread_rwlock_t definition).
  1400. // It should contain at least the internal members defined in the
  1401. // generic version.
  1402. //
  1403. // 2. The macro __PTHREAD_RWLOCK_INITIALIZER used for static initialization.
  1404. // It should initialize the rwlock internal type.
  1405. // RISC-V internal rwlock struct definitions.
  1406. // Copyright (C) 2019-2021 Free Software Foundation, Inc.
  1407. //
  1408. // This file is part of the GNU C Library.
  1409. //
  1410. // The GNU C Library is free software; you can redistribute it and/or
  1411. // modify it under the terms of the GNU Lesser General Public
  1412. // License as published by the Free Software Foundation; either
  1413. // version 2.1 of the License, or (at your option) any later version.
  1414. //
  1415. // The GNU C Library is distributed in the hope that it will be useful,
  1416. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  1417. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1418. // Lesser General Public License for more details.
  1419. //
  1420. // You should have received a copy of the GNU Lesser General Public
  1421. // License along with the GNU C Library; if not, see
  1422. // <https://www.gnu.org/licenses/>.
  1423. // There is a lot of padding in this structure. While it's not strictly
  1424. //
  1425. // necessary on RISC-V, we're going to leave it in to be on the safe side in
  1426. // case it's needed in the future. Most other architectures have the padding,
  1427. // so this gives us the same extensibility as everyone else has.
  1428. type X__pthread_rwlock_arch_t = struct {
  1429. F__readers uint32
  1430. F__writers uint32
  1431. F__wrphase_futex uint32
  1432. F__writers_futex uint32
  1433. F__pad3 uint32
  1434. F__pad4 uint32
  1435. F__cur_writer int32
  1436. F__shared int32
  1437. F__pad1 uint64
  1438. F__pad2 uint64
  1439. F__flags uint32
  1440. F__ccgo_pad1 [4]byte
  1441. } /* struct_rwlock.h:27:1 */
  1442. // Common definition of pthread_cond_t.
  1443. type X__pthread_cond_s = struct {
  1444. F__0 struct{ F__wseq uint64 }
  1445. F__8 struct{ F__g1_start uint64 }
  1446. F__g_refs [2]uint32
  1447. F__g_size [2]uint32
  1448. F__g1_orig_size uint32
  1449. F__wrefs uint32
  1450. F__g_signals [2]uint32
  1451. } /* thread-shared-types.h:92:1 */
  1452. type X__tss_t = uint32 /* thread-shared-types.h:119:22 */
  1453. type X__thrd_t = uint64 /* thread-shared-types.h:120:27 */
  1454. type X__once_flag = struct{ F__data int32 } /* thread-shared-types.h:125:3 */
  1455. // Thread identifiers. The structure of the attribute type is not
  1456. //
  1457. // exposed on purpose.
  1458. type Pthread_t = uint64 /* pthreadtypes.h:27:27 */
  1459. // Data structures for mutex handling. The structure of the attribute
  1460. //
  1461. // type is not exposed on purpose.
  1462. type Pthread_mutexattr_t = struct {
  1463. F__ccgo_pad1 [0]uint32
  1464. F__size [4]uint8
  1465. } /* pthreadtypes.h:36:3 */
  1466. // Data structure for condition variable handling. The structure of
  1467. //
  1468. // the attribute type is not exposed on purpose.
  1469. type Pthread_condattr_t = struct {
  1470. F__ccgo_pad1 [0]uint32
  1471. F__size [4]uint8
  1472. } /* pthreadtypes.h:45:3 */
  1473. // Keys for thread-specific data
  1474. type Pthread_key_t = uint32 /* pthreadtypes.h:49:22 */
  1475. // Once-only execution
  1476. type Pthread_once_t = int32 /* pthreadtypes.h:53:30 */
  1477. type Pthread_attr_t1 = struct {
  1478. F__ccgo_pad1 [0]uint64
  1479. F__size [56]uint8
  1480. } /* pthreadtypes.h:56:1 */
  1481. type Pthread_attr_t = Pthread_attr_t1 /* pthreadtypes.h:62:30 */
  1482. type Pthread_mutex_t = struct{ F__data X__pthread_mutex_s } /* pthreadtypes.h:72:3 */
  1483. type Pthread_cond_t = struct{ F__data X__pthread_cond_s } /* pthreadtypes.h:80:3 */
  1484. // Data structure for reader-writer lock variable handling. The
  1485. //
  1486. // structure of the attribute type is deliberately not exposed.
  1487. type Pthread_rwlock_t = struct{ F__data X__pthread_rwlock_arch_t } /* pthreadtypes.h:91:3 */
  1488. type Pthread_rwlockattr_t = struct {
  1489. F__ccgo_pad1 [0]uint64
  1490. F__size [8]uint8
  1491. } /* pthreadtypes.h:97:3 */
  1492. // POSIX spinlock data type.
  1493. type Pthread_spinlock_t = int32 /* pthreadtypes.h:103:22 */
  1494. // POSIX barriers data type. The structure of the type is
  1495. //
  1496. // deliberately not exposed.
  1497. type Pthread_barrier_t = struct {
  1498. F__ccgo_pad1 [0]uint64
  1499. F__size [32]uint8
  1500. } /* pthreadtypes.h:112:3 */
  1501. type Pthread_barrierattr_t = struct {
  1502. F__ccgo_pad1 [0]uint32
  1503. F__size [4]uint8
  1504. } /* pthreadtypes.h:118:3 */
  1505. // Type for length arguments in socket calls.
  1506. type Socklen_t = X__socklen_t /* socket.h:33:21 */
  1507. // Protocol families.
  1508. // Address families.
  1509. // Socket level values. Others are defined in the appropriate headers.
  1510. //
  1511. // XXX These definitions also should go into the appropriate headers as
  1512. // far as they are available.
  1513. // Maximum queue length specifiable by listen.
  1514. // Get the definition of the macro to define the common sockaddr members.
  1515. // Definition of struct sockaddr_* common members and sizes, generic version.
  1516. // Copyright (C) 1995-2021 Free Software Foundation, Inc.
  1517. // This file is part of the GNU C Library.
  1518. //
  1519. // The GNU C Library is free software; you can redistribute it and/or
  1520. // modify it under the terms of the GNU Lesser General Public
  1521. // License as published by the Free Software Foundation; either
  1522. // version 2.1 of the License, or (at your option) any later version.
  1523. //
  1524. // The GNU C Library is distributed in the hope that it will be useful,
  1525. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  1526. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1527. // Lesser General Public License for more details.
  1528. //
  1529. // You should have received a copy of the GNU Lesser General Public
  1530. // License along with the GNU C Library; if not, see
  1531. // <https://www.gnu.org/licenses/>.
  1532. // Never include this file directly; use <sys/socket.h> instead.
  1533. // POSIX.1g specifies this type name for the `sa_family' member.
  1534. type Sa_family_t = uint16 /* sockaddr.h:28:28 */
  1535. // This macro is used to declare the initial common members
  1536. // of the data types used for socket addresses, `struct sockaddr',
  1537. // `struct sockaddr_in', `struct sockaddr_un', etc.
  1538. // Size of struct sockaddr_storage.
  1539. // Structure describing a generic socket address.
  1540. type Sockaddr = struct {
  1541. Fsa_family Sa_family_t
  1542. Fsa_data [14]uint8
  1543. } /* socket.h:178:1 */
  1544. // Structure large enough to hold any socket address (with the historical
  1545. // exception of AF_UNIX).
  1546. type Sockaddr_storage = struct {
  1547. Fss_family Sa_family_t
  1548. F__ss_padding [118]uint8
  1549. F__ss_align uint64
  1550. } /* socket.h:191:1 */
  1551. // Structure describing messages sent by
  1552. //
  1553. // `sendmsg' and received by `recvmsg'.
  1554. type Msghdr = struct {
  1555. Fmsg_name uintptr
  1556. Fmsg_namelen Socklen_t
  1557. F__ccgo_pad1 [4]byte
  1558. Fmsg_iov uintptr
  1559. Fmsg_iovlen Size_t
  1560. Fmsg_control uintptr
  1561. Fmsg_controllen Size_t
  1562. Fmsg_flags int32
  1563. F__ccgo_pad2 [4]byte
  1564. } /* socket.h:257:1 */
  1565. // Structure used for storage of ancillary data object information.
  1566. type Cmsghdr = struct {
  1567. F__ccgo_pad1 [0]uint64
  1568. Fcmsg_len Size_t
  1569. Fcmsg_level int32
  1570. Fcmsg_type int32
  1571. } /* socket.h:275:1 */
  1572. // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
  1573. // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
  1574. // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
  1575. // This allows for 1024 file descriptors: if NR_OPEN is ever grown
  1576. // beyond that you'll have to change this too. But 1024 fd's seem to be
  1577. // enough even for such "real" unices like OSF/1, so hopefully this is
  1578. // one limit that doesn't have to be changed [again].
  1579. //
  1580. // Note that POSIX wants the FD_CLEAR(fd,fdsetp) defines to be in
  1581. // <sys/time.h> (and thus <linux/time.h>) - but this is a more logical
  1582. // place for them. Solved by having dummy defines in <sys/time.h>.
  1583. // This macro may have been defined in <gnu/types.h>. But we always
  1584. // use the one here.
  1585. type X__kernel_fd_set = struct{ Ffds_bits [16]uint64 } /* posix_types.h:27:3 */
  1586. // Type of a signal handler.
  1587. type X__kernel_sighandler_t = uintptr /* posix_types.h:30:14 */
  1588. // Type of a SYSV IPC key.
  1589. type X__kernel_key_t = int32 /* posix_types.h:33:13 */
  1590. type X__kernel_mqd_t = int32 /* posix_types.h:34:13 */
  1591. // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
  1592. // SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note
  1593. // Copyright (C) 2012 ARM Ltd.
  1594. // Copyright (C) 2015 Regents of the University of California
  1595. // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
  1596. // There seems to be no way of detecting this automatically from user
  1597. // space, so 64 bit architectures should override this in their
  1598. // bitsperlong.h. In particular, an architecture that supports
  1599. // both 32 and 64 bit user space must not rely on CONFIG_64BIT
  1600. // to decide it, but rather check a compiler provided macro.
  1601. // This file is generally used by user-level software, so you need to
  1602. // be a little careful about namespace pollution etc.
  1603. //
  1604. // First the types that are often defined in different ways across
  1605. // architectures, so that you can override them.
  1606. type X__kernel_long_t = int64 /* posix_types.h:15:15 */
  1607. type X__kernel_ulong_t = uint64 /* posix_types.h:16:23 */
  1608. type X__kernel_ino_t = X__kernel_ulong_t /* posix_types.h:20:26 */
  1609. type X__kernel_mode_t = uint32 /* posix_types.h:24:22 */
  1610. type X__kernel_pid_t = int32 /* posix_types.h:28:14 */
  1611. type X__kernel_ipc_pid_t = int32 /* posix_types.h:32:14 */
  1612. type X__kernel_uid_t = uint32 /* posix_types.h:36:22 */
  1613. type X__kernel_gid_t = uint32 /* posix_types.h:37:22 */
  1614. type X__kernel_suseconds_t = X__kernel_long_t /* posix_types.h:41:26 */
  1615. type X__kernel_daddr_t = int32 /* posix_types.h:45:14 */
  1616. type X__kernel_uid32_t = uint32 /* posix_types.h:49:22 */
  1617. type X__kernel_gid32_t = uint32 /* posix_types.h:50:22 */
  1618. type X__kernel_old_uid_t = X__kernel_uid_t /* posix_types.h:54:24 */
  1619. type X__kernel_old_gid_t = X__kernel_gid_t /* posix_types.h:55:24 */
  1620. type X__kernel_old_dev_t = uint32 /* posix_types.h:59:22 */
  1621. // Most 32 bit architectures use "unsigned int" size_t,
  1622. // and all 64 bit architectures use "unsigned long" size_t.
  1623. type X__kernel_size_t = X__kernel_ulong_t /* posix_types.h:72:26 */
  1624. type X__kernel_ssize_t = X__kernel_long_t /* posix_types.h:73:25 */
  1625. type X__kernel_ptrdiff_t = X__kernel_long_t /* posix_types.h:74:25 */
  1626. type X__kernel_fsid_t = struct{ Fval [2]int32 } /* posix_types.h:81:3 */
  1627. // anything below here should be completely generic
  1628. type X__kernel_off_t = X__kernel_long_t /* posix_types.h:87:25 */
  1629. type X__kernel_loff_t = int64 /* posix_types.h:88:19 */
  1630. type X__kernel_old_time_t = X__kernel_long_t /* posix_types.h:89:25 */
  1631. type X__kernel_time_t = X__kernel_long_t /* posix_types.h:90:25 */
  1632. type X__kernel_time64_t = int64 /* posix_types.h:91:19 */
  1633. type X__kernel_clock_t = X__kernel_long_t /* posix_types.h:92:25 */
  1634. type X__kernel_timer_t = int32 /* posix_types.h:93:14 */
  1635. type X__kernel_clockid_t = int32 /* posix_types.h:94:14 */
  1636. type X__kernel_caddr_t = uintptr /* posix_types.h:95:14 */
  1637. type X__kernel_uid16_t = uint16 /* posix_types.h:96:24 */
  1638. type X__kernel_gid16_t = uint16 /* posix_types.h:97:24 */
  1639. // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
  1640. // Socket-level I/O control calls.
  1641. // For setsockopt(2)
  1642. // Security levels - as per NRL IPv6 - don't actually do anything
  1643. // Socket filtering
  1644. // Instruct lower device to use last 4-bytes of skb data as FCS
  1645. // on 64-bit and x32, avoid the ?: operator
  1646. // Structure used to manipulate the SO_LINGER option.
  1647. type Linger = struct {
  1648. Fl_onoff int32
  1649. Fl_linger int32
  1650. } /* socket.h:361:1 */
  1651. // This is the 4.3 BSD `struct sockaddr' format, which is used as wire
  1652. //
  1653. // format in the grotty old 4.3 `talk' protocol.
  1654. type Osockaddr = struct {
  1655. Fsa_family uint16
  1656. Fsa_data [14]uint8
  1657. } /* struct_osockaddr.h:6:1 */
  1658. // Define some macros helping to catch buffer overflows.
  1659. var _ uint8 /* gen.c:2:13: */