socket_linux_amd64.go 80 KB

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