ccgo_linux_ppc64le.go 58 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947
  1. // Code generated for linux/ppc64le by 'generator --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-macro=m_ --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-link-errors -extended-errors -o libxau.go --package-name libxau .libs/libXau.a', DO NOT EDIT.
  2. //go:build linux && ppc64le
  3. package libxau
  4. import (
  5. "reflect"
  6. "unsafe"
  7. "modernc.org/libc"
  8. )
  9. var _ reflect.Type
  10. var _ unsafe.Pointer
  11. const m_BUFSIZ = 1024
  12. const m_EXIT_FAILURE = 1
  13. const m_EXIT_SUCCESS = 0
  14. const m_FILENAME_MAX = 4096
  15. const m_FOPEN_MAX = 1000
  16. const m_FUNCPROTO = 15
  17. const m_FamilyKrb5Principal = 253
  18. const m_FamilyLocal = 256
  19. const m_FamilyLocalHost = 252
  20. const m_FamilyNetname = 254
  21. const m_FamilyWild = 65535
  22. const m_HAVE_CONFIG_H = 1
  23. const m_HAVE_DLFCN_H = 1
  24. const m_HAVE_INTTYPES_H = 1
  25. const m_HAVE_MEMORY_H = 1
  26. const m_HAVE_PATHCONF = 1
  27. const m_HAVE_STDINT_H = 1
  28. const m_HAVE_STDLIB_H = 1
  29. const m_HAVE_STRINGS_H = 1
  30. const m_HAVE_STRING_H = 1
  31. const m_HAVE_SYS_STAT_H = 1
  32. const m_HAVE_SYS_TYPES_H = 1
  33. const m_HAVE_UNISTD_H = 1
  34. const m_LOCK_ERROR = 1
  35. const m_LOCK_SUCCESS = 0
  36. const m_LOCK_TIMEOUT = 2
  37. const m_LT_OBJDIR = ".libs/"
  38. const m_L_ctermid = 20
  39. const m_L_cuserid = 20
  40. const m_L_tmpnam = 20
  41. const m_NDEBUG = 1
  42. const m_NeedFunctionPrototypes = 1
  43. const m_NeedNestedPrototypes = 1
  44. const m_NeedVarargsPrototypes = 1
  45. const m_NeedWidePrototypes = 0
  46. const m_PACKAGE = "libXau"
  47. const m_PACKAGE_BUGREPORT = "https://gitlab.freedesktop.org/xorg/lib/libXau/issues"
  48. const m_PACKAGE_NAME = "libXau"
  49. const m_PACKAGE_STRING = "libXau 1.0.9"
  50. const m_PACKAGE_TARNAME = "libXau"
  51. const m_PACKAGE_URL = ""
  52. const m_PACKAGE_VERSION = "1.0.9"
  53. const m_PACKAGE_VERSION_MAJOR = 1
  54. const m_PACKAGE_VERSION_MINOR = 0
  55. const m_PACKAGE_VERSION_PATCHLEVEL = 9
  56. const m_P_tmpdir = "/tmp"
  57. const m_RAND_MAX = 0x7fffffff
  58. const m_STDC_HEADERS = 1
  59. const m_TMP_MAX = 10000
  60. const m_VERSION = "1.0.9"
  61. const m_WNOHANG = 1
  62. const m_WUNTRACED = 2
  63. const m_XTHREADS = 1
  64. const m_XUSE_MTSAFE_API = 1
  65. const m__ALL_SOURCE = 1
  66. const m__ARCH_PPC = 1
  67. const m__ARCH_PPC64 = 1
  68. const m__ARCH_PPCGR = 1
  69. const m__ARCH_PPCSQ = 1
  70. const m__ARCH_PWR4 = 1
  71. const m__ARCH_PWR5 = 1
  72. const m__ARCH_PWR5X = 1
  73. const m__ARCH_PWR6 = 1
  74. const m__ARCH_PWR7 = 1
  75. const m__ARCH_PWR8 = 1
  76. const m__CALL_ELF = 2
  77. const m__CALL_LINUX = 1
  78. const m__GNU_SOURCE = 1
  79. const m__IOFBF = 0
  80. const m__IOLBF = 1
  81. const m__IONBF = 2
  82. const m__LITTLE_ENDIAN = 1
  83. const m__LP64 = 1
  84. const m__POSIX_PTHREAD_SEMANTICS = 1
  85. const m__STDC_PREDEF_H = 1
  86. const m__TANDEM_SOURCE = 1
  87. const m__X_INLINE = "inline"
  88. const m__X_RESTRICT_KYWD = "restrict"
  89. const m__Xconst = "const"
  90. const m___ALTIVEC__ = 1
  91. const m___APPLE_ALTIVEC__ = 1
  92. const m___ATOMIC_ACQUIRE = 2
  93. const m___ATOMIC_ACQ_REL = 4
  94. const m___ATOMIC_CONSUME = 1
  95. const m___ATOMIC_RELAXED = 0
  96. const m___ATOMIC_RELEASE = 3
  97. const m___ATOMIC_SEQ_CST = 5
  98. const m___BIGGEST_ALIGNMENT__ = 16
  99. const m___BIG_ENDIAN = 4321
  100. const m___BUILTIN_CPU_SUPPORTS__ = 1
  101. const m___BYTE_ORDER = 1234
  102. const m___BYTE_ORDER__ = "__ORDER_LITTLE_ENDIAN__"
  103. const m___CCGO__ = 1
  104. const m___CHAR_BIT__ = 8
  105. const m___CHAR_UNSIGNED__ = 1
  106. const m___CMODEL_MEDIUM__ = 1
  107. const m___CRYPTO__ = 1
  108. const m___DBL_DECIMAL_DIG__ = 17
  109. const m___DBL_DIG__ = 15
  110. const m___DBL_HAS_DENORM__ = 1
  111. const m___DBL_HAS_INFINITY__ = 1
  112. const m___DBL_HAS_QUIET_NAN__ = 1
  113. const m___DBL_MANT_DIG__ = 53
  114. const m___DBL_MAX_10_EXP__ = 308
  115. const m___DBL_MAX_EXP__ = 1024
  116. const m___DEC128_EPSILON__ = 1e-33
  117. const m___DEC128_MANT_DIG__ = 34
  118. const m___DEC128_MAX_EXP__ = 6145
  119. const m___DEC128_MAX__ = "9.999999999999999999999999999999999E6144"
  120. const m___DEC128_MIN__ = 1e-6143
  121. const m___DEC128_SUBNORMAL_MIN__ = 0.000000000000000000000000000000001e-6143
  122. const m___DEC32_EPSILON__ = 1e-6
  123. const m___DEC32_MANT_DIG__ = 7
  124. const m___DEC32_MAX_EXP__ = 97
  125. const m___DEC32_MAX__ = 9.999999e96
  126. const m___DEC32_MIN__ = 1e-95
  127. const m___DEC32_SUBNORMAL_MIN__ = 0.000001e-95
  128. const m___DEC64_EPSILON__ = 1e-15
  129. const m___DEC64_MANT_DIG__ = 16
  130. const m___DEC64_MAX_EXP__ = 385
  131. const m___DEC64_MAX__ = "9.999999999999999E384"
  132. const m___DEC64_MIN__ = 1e-383
  133. const m___DEC64_SUBNORMAL_MIN__ = 0.000000000000001e-383
  134. const m___DECIMAL_DIG__ = 17
  135. const m___DEC_EVAL_METHOD__ = 2
  136. const m___ELF__ = 1
  137. const m___EXTENSIONS__ = 1
  138. const m___FINITE_MATH_ONLY__ = 0
  139. const m___FLOAT128_TYPE__ = 1
  140. const m___FLOAT128__ = 1
  141. const m___FLOAT_WORD_ORDER__ = "__ORDER_LITTLE_ENDIAN__"
  142. const m___FLT128_DECIMAL_DIG__ = 36
  143. const m___FLT128_DENORM_MIN__ = 6.47517511943802511092443895822764655e-4966
  144. const m___FLT128_DIG__ = 33
  145. const m___FLT128_EPSILON__ = 1.92592994438723585305597794258492732e-34
  146. const m___FLT128_HAS_DENORM__ = 1
  147. const m___FLT128_HAS_INFINITY__ = 1
  148. const m___FLT128_HAS_QUIET_NAN__ = 1
  149. const m___FLT128_MANT_DIG__ = 113
  150. const m___FLT128_MAX_10_EXP__ = 4932
  151. const m___FLT128_MAX_EXP__ = 16384
  152. const m___FLT128_MAX__ = "1.18973149535723176508575932662800702e+4932"
  153. const m___FLT128_MIN__ = 3.36210314311209350626267781732175260e-4932
  154. const m___FLT128_NORM_MAX__ = "1.18973149535723176508575932662800702e+4932"
  155. const m___FLT32X_DECIMAL_DIG__ = 17
  156. const m___FLT32X_DENORM_MIN__ = 4.94065645841246544176568792868221372e-324
  157. const m___FLT32X_DIG__ = 15
  158. const m___FLT32X_EPSILON__ = 2.22044604925031308084726333618164062e-16
  159. const m___FLT32X_HAS_DENORM__ = 1
  160. const m___FLT32X_HAS_INFINITY__ = 1
  161. const m___FLT32X_HAS_QUIET_NAN__ = 1
  162. const m___FLT32X_MANT_DIG__ = 53
  163. const m___FLT32X_MAX_10_EXP__ = 308
  164. const m___FLT32X_MAX_EXP__ = 1024
  165. const m___FLT32X_MAX__ = 1.79769313486231570814527423731704357e+308
  166. const m___FLT32X_MIN__ = 2.22507385850720138309023271733240406e-308
  167. const m___FLT32X_NORM_MAX__ = 1.79769313486231570814527423731704357e+308
  168. const m___FLT32_DECIMAL_DIG__ = 9
  169. const m___FLT32_DENORM_MIN__ = 1.40129846432481707092372958328991613e-45
  170. const m___FLT32_DIG__ = 6
  171. const m___FLT32_EPSILON__ = 1.19209289550781250000000000000000000e-7
  172. const m___FLT32_HAS_DENORM__ = 1
  173. const m___FLT32_HAS_INFINITY__ = 1
  174. const m___FLT32_HAS_QUIET_NAN__ = 1
  175. const m___FLT32_MANT_DIG__ = 24
  176. const m___FLT32_MAX_10_EXP__ = 38
  177. const m___FLT32_MAX_EXP__ = 128
  178. const m___FLT32_MAX__ = 3.40282346638528859811704183484516925e+38
  179. const m___FLT32_MIN__ = 1.17549435082228750796873653722224568e-38
  180. const m___FLT32_NORM_MAX__ = 3.40282346638528859811704183484516925e+38
  181. const m___FLT64X_DECIMAL_DIG__ = 36
  182. const m___FLT64X_DENORM_MIN__ = 6.47517511943802511092443895822764655e-4966
  183. const m___FLT64X_DIG__ = 33
  184. const m___FLT64X_EPSILON__ = 1.92592994438723585305597794258492732e-34
  185. const m___FLT64X_HAS_DENORM__ = 1
  186. const m___FLT64X_HAS_INFINITY__ = 1
  187. const m___FLT64X_HAS_QUIET_NAN__ = 1
  188. const m___FLT64X_MANT_DIG__ = 113
  189. const m___FLT64X_MAX_10_EXP__ = 4932
  190. const m___FLT64X_MAX_EXP__ = 16384
  191. const m___FLT64X_MAX__ = "1.18973149535723176508575932662800702e+4932"
  192. const m___FLT64X_MIN__ = 3.36210314311209350626267781732175260e-4932
  193. const m___FLT64X_NORM_MAX__ = "1.18973149535723176508575932662800702e+4932"
  194. const m___FLT64_DECIMAL_DIG__ = 17
  195. const m___FLT64_DENORM_MIN__ = 4.94065645841246544176568792868221372e-324
  196. const m___FLT64_DIG__ = 15
  197. const m___FLT64_EPSILON__ = 2.22044604925031308084726333618164062e-16
  198. const m___FLT64_HAS_DENORM__ = 1
  199. const m___FLT64_HAS_INFINITY__ = 1
  200. const m___FLT64_HAS_QUIET_NAN__ = 1
  201. const m___FLT64_MANT_DIG__ = 53
  202. const m___FLT64_MAX_10_EXP__ = 308
  203. const m___FLT64_MAX_EXP__ = 1024
  204. const m___FLT64_MAX__ = 1.79769313486231570814527423731704357e+308
  205. const m___FLT64_MIN__ = 2.22507385850720138309023271733240406e-308
  206. const m___FLT64_NORM_MAX__ = 1.79769313486231570814527423731704357e+308
  207. const m___FLT_DECIMAL_DIG__ = 9
  208. const m___FLT_DENORM_MIN__ = 1.40129846432481707092372958328991613e-45
  209. const m___FLT_DIG__ = 6
  210. const m___FLT_EPSILON__ = 1.19209289550781250000000000000000000e-7
  211. const m___FLT_EVAL_METHOD_TS_18661_3__ = 0
  212. const m___FLT_EVAL_METHOD__ = 0
  213. const m___FLT_HAS_DENORM__ = 1
  214. const m___FLT_HAS_INFINITY__ = 1
  215. const m___FLT_HAS_QUIET_NAN__ = 1
  216. const m___FLT_MANT_DIG__ = 24
  217. const m___FLT_MAX_10_EXP__ = 38
  218. const m___FLT_MAX_EXP__ = 128
  219. const m___FLT_MAX__ = 3.40282346638528859811704183484516925e+38
  220. const m___FLT_MIN__ = 1.17549435082228750796873653722224568e-38
  221. const m___FLT_NORM_MAX__ = 3.40282346638528859811704183484516925e+38
  222. const m___FLT_RADIX__ = 2
  223. const m___FP_FAST_FMA = 1
  224. const m___FP_FAST_FMAF = 1
  225. const m___FP_FAST_FMAF32 = 1
  226. const m___FP_FAST_FMAF32x = 1
  227. const m___FP_FAST_FMAF64 = 1
  228. const m___FP_FAST_FMAL = 1
  229. const m___FUNCTION__ = "__func__"
  230. const m___GCC_ATOMIC_BOOL_LOCK_FREE = 2
  231. const m___GCC_ATOMIC_CHAR16_T_LOCK_FREE = 2
  232. const m___GCC_ATOMIC_CHAR32_T_LOCK_FREE = 2
  233. const m___GCC_ATOMIC_CHAR_LOCK_FREE = 2
  234. const m___GCC_ATOMIC_INT_LOCK_FREE = 2
  235. const m___GCC_ATOMIC_LLONG_LOCK_FREE = 2
  236. const m___GCC_ATOMIC_LONG_LOCK_FREE = 2
  237. const m___GCC_ATOMIC_POINTER_LOCK_FREE = 2
  238. const m___GCC_ATOMIC_SHORT_LOCK_FREE = 2
  239. const m___GCC_ATOMIC_TEST_AND_SET_TRUEVAL = 1
  240. const m___GCC_ATOMIC_WCHAR_T_LOCK_FREE = 2
  241. const m___GCC_HAVE_DWARF2_CFI_ASM = 1
  242. const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 = 1
  243. const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 = 1
  244. const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 = 1
  245. const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 = 1
  246. const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 = 1
  247. const m___GCC_IEC_559 = 2
  248. const m___GCC_IEC_559_COMPLEX = 2
  249. const m___GNUC_MINOR__ = 2
  250. const m___GNUC_PATCHLEVEL__ = 1
  251. const m___GNUC_STDC_INLINE__ = 1
  252. const m___GNUC__ = 10
  253. const m___GXX_ABI_VERSION = 1014
  254. const m___HAVE_BSWAP__ = 1
  255. const m___HAVE_SPECULATION_SAFE_VALUE = 1
  256. const m___HTM__ = 1
  257. const m___INT16_MAX__ = 0x7fff
  258. const m___INT32_MAX__ = 0x7fffffff
  259. const m___INT32_TYPE__ = "int"
  260. const m___INT64_MAX__ = 0x7fffffffffffffff
  261. const m___INT8_MAX__ = 0x7f
  262. const m___INTMAX_MAX__ = 0x7fffffffffffffff
  263. const m___INTMAX_WIDTH__ = 64
  264. const m___INTPTR_MAX__ = 0x7fffffffffffffff
  265. const m___INTPTR_WIDTH__ = 64
  266. const m___INT_FAST16_MAX__ = 0x7fffffffffffffff
  267. const m___INT_FAST16_WIDTH__ = 64
  268. const m___INT_FAST32_MAX__ = 0x7fffffffffffffff
  269. const m___INT_FAST32_WIDTH__ = 64
  270. const m___INT_FAST64_MAX__ = 0x7fffffffffffffff
  271. const m___INT_FAST64_WIDTH__ = 64
  272. const m___INT_FAST8_MAX__ = 0x7f
  273. const m___INT_FAST8_WIDTH__ = 8
  274. const m___INT_LEAST16_MAX__ = 0x7fff
  275. const m___INT_LEAST16_WIDTH__ = 16
  276. const m___INT_LEAST32_MAX__ = 0x7fffffff
  277. const m___INT_LEAST32_TYPE__ = "int"
  278. const m___INT_LEAST32_WIDTH__ = 32
  279. const m___INT_LEAST64_MAX__ = 0x7fffffffffffffff
  280. const m___INT_LEAST64_WIDTH__ = 64
  281. const m___INT_LEAST8_MAX__ = 0x7f
  282. const m___INT_LEAST8_WIDTH__ = 8
  283. const m___INT_MAX__ = 0x7fffffff
  284. const m___INT_WIDTH__ = 32
  285. const m___LDBL_DECIMAL_DIG__ = 17
  286. const m___LDBL_DENORM_MIN__ = 4.94065645841246544176568792868221372e-324
  287. const m___LDBL_DIG__ = 15
  288. const m___LDBL_EPSILON__ = 2.22044604925031308084726333618164062e-16
  289. const m___LDBL_HAS_DENORM__ = 1
  290. const m___LDBL_HAS_INFINITY__ = 1
  291. const m___LDBL_HAS_QUIET_NAN__ = 1
  292. const m___LDBL_MANT_DIG__ = 53
  293. const m___LDBL_MAX_10_EXP__ = 308
  294. const m___LDBL_MAX_EXP__ = 1024
  295. const m___LDBL_MAX__ = 1.79769313486231570814527423731704357e+308
  296. const m___LDBL_MIN__ = 2.22507385850720138309023271733240406e-308
  297. const m___LDBL_NORM_MAX__ = 1.79769313486231570814527423731704357e+308
  298. const m___LITTLE_ENDIAN = 1234
  299. const m___LITTLE_ENDIAN__ = 1
  300. const m___LONG_LONG_MAX__ = 0x7fffffffffffffff
  301. const m___LONG_LONG_WIDTH__ = 64
  302. const m___LONG_MAX = 0x7fffffffffffffff
  303. const m___LONG_MAX__ = 0x7fffffffffffffff
  304. const m___LONG_WIDTH__ = 64
  305. const m___LP64__ = 1
  306. const m___NO_INLINE__ = 1
  307. const m___ORDER_BIG_ENDIAN__ = 4321
  308. const m___ORDER_LITTLE_ENDIAN__ = 1234
  309. const m___ORDER_PDP_ENDIAN__ = 3412
  310. const m___PIC__ = 2
  311. const m___PIE__ = 2
  312. const m___POWER8_VECTOR__ = 1
  313. const m___PPC64__ = 1
  314. const m___PPC__ = 1
  315. const m___PRAGMA_REDEFINE_EXTNAME = 1
  316. const m___PRETTY_FUNCTION__ = "__func__"
  317. const m___PTRDIFF_MAX__ = 0x7fffffffffffffff
  318. const m___PTRDIFF_WIDTH__ = 64
  319. const m___QUAD_MEMORY_ATOMIC__ = 1
  320. const m___RECIPF__ = 1
  321. const m___RECIP_PRECISION__ = 1
  322. const m___RECIP__ = 1
  323. const m___RSQRTEF__ = 1
  324. const m___RSQRTE__ = 1
  325. const m___SCHAR_MAX__ = 0x7f
  326. const m___SCHAR_WIDTH__ = 8
  327. const m___SHRT_MAX__ = 0x7fff
  328. const m___SHRT_WIDTH__ = 16
  329. const m___SIG_ATOMIC_MAX__ = 0x7fffffff
  330. const m___SIG_ATOMIC_TYPE__ = "int"
  331. const m___SIG_ATOMIC_WIDTH__ = 32
  332. const m___SIZEOF_DOUBLE__ = 8
  333. const m___SIZEOF_FLOAT__ = 4
  334. const m___SIZEOF_INT128__ = 16
  335. const m___SIZEOF_INT__ = 4
  336. const m___SIZEOF_LONG_DOUBLE__ = 8
  337. const m___SIZEOF_LONG_LONG__ = 8
  338. const m___SIZEOF_LONG__ = 8
  339. const m___SIZEOF_POINTER__ = 8
  340. const m___SIZEOF_PTRDIFF_T__ = 8
  341. const m___SIZEOF_SHORT__ = 2
  342. const m___SIZEOF_SIZE_T__ = 8
  343. const m___SIZEOF_WCHAR_T__ = 4
  344. const m___SIZEOF_WINT_T__ = 4
  345. const m___SIZE_MAX__ = 0xffffffffffffffff
  346. const m___SIZE_WIDTH__ = 64
  347. const m___STDC_HOSTED__ = 1
  348. const m___STDC_IEC_559_COMPLEX__ = 1
  349. const m___STDC_IEC_559__ = 1
  350. const m___STDC_ISO_10646__ = 201706
  351. const m___STDC_UTF_16__ = 1
  352. const m___STDC_UTF_32__ = 1
  353. const m___STDC_VERSION__ = 201710
  354. const m___STDC__ = 1
  355. const m___STRUCT_PARM_ALIGN__ = 16
  356. const m___TM_FENCE__ = 1
  357. const m___UINT16_MAX__ = 0xffff
  358. const m___UINT32_MAX__ = 0xffffffff
  359. const m___UINT64_MAX__ = 0xffffffffffffffff
  360. const m___UINT8_MAX__ = 0xff
  361. const m___UINTMAX_MAX__ = 0xffffffffffffffff
  362. const m___UINTPTR_MAX__ = 0xffffffffffffffff
  363. const m___UINT_FAST16_MAX__ = 0xffffffffffffffff
  364. const m___UINT_FAST32_MAX__ = 0xffffffffffffffff
  365. const m___UINT_FAST64_MAX__ = 0xffffffffffffffff
  366. const m___UINT_FAST8_MAX__ = 0xff
  367. const m___UINT_LEAST16_MAX__ = 0xffff
  368. const m___UINT_LEAST32_MAX__ = 0xffffffff
  369. const m___UINT_LEAST64_MAX__ = 0xffffffffffffffff
  370. const m___UINT_LEAST8_MAX__ = 0xff
  371. const m___USE_TIME_BITS64 = 1
  372. const m___VEC_ELEMENT_REG_ORDER__ = "__ORDER_LITTLE_ENDIAN__"
  373. const m___VEC__ = 10206
  374. const m___VERSION__ = "10.2.1 20210110"
  375. const m___VSX__ = 1
  376. const m___WCHAR_MAX__ = 0x7fffffff
  377. const m___WCHAR_TYPE__ = "int"
  378. const m___WCHAR_WIDTH__ = 32
  379. const m___WINT_MAX__ = 0xffffffff
  380. const m___WINT_MIN__ = 0
  381. const m___WINT_WIDTH__ = 32
  382. const m___builtin_copysignq = "__builtin_copysignf128"
  383. const m___builtin_fabsq = "__builtin_fabsf128"
  384. const m___builtin_huge_valq = "__builtin_huge_valf128"
  385. const m___builtin_infq = "__builtin_inff128"
  386. const m___builtin_nanq = "__builtin_nanf128"
  387. const m___builtin_nansq = "__builtin_nansf128"
  388. const m___builtin_vsx_vperm = "__builtin_vec_perm"
  389. const m___builtin_vsx_xvmaddadp = "__builtin_vsx_xvmadddp"
  390. const m___builtin_vsx_xvmaddasp = "__builtin_vsx_xvmaddsp"
  391. const m___builtin_vsx_xvmaddmdp = "__builtin_vsx_xvmadddp"
  392. const m___builtin_vsx_xvmaddmsp = "__builtin_vsx_xvmaddsp"
  393. const m___builtin_vsx_xvmsubadp = "__builtin_vsx_xvmsubdp"
  394. const m___builtin_vsx_xvmsubasp = "__builtin_vsx_xvmsubsp"
  395. const m___builtin_vsx_xvmsubmdp = "__builtin_vsx_xvmsubdp"
  396. const m___builtin_vsx_xvmsubmsp = "__builtin_vsx_xvmsubsp"
  397. const m___builtin_vsx_xvnmaddadp = "__builtin_vsx_xvnmadddp"
  398. const m___builtin_vsx_xvnmaddasp = "__builtin_vsx_xvnmaddsp"
  399. const m___builtin_vsx_xvnmaddmdp = "__builtin_vsx_xvnmadddp"
  400. const m___builtin_vsx_xvnmaddmsp = "__builtin_vsx_xvnmaddsp"
  401. const m___builtin_vsx_xvnmsubadp = "__builtin_vsx_xvnmsubdp"
  402. const m___builtin_vsx_xvnmsubasp = "__builtin_vsx_xvnmsubsp"
  403. const m___builtin_vsx_xvnmsubmdp = "__builtin_vsx_xvnmsubdp"
  404. const m___builtin_vsx_xvnmsubmsp = "__builtin_vsx_xvnmsubsp"
  405. const m___builtin_vsx_xxland = "__builtin_vec_and"
  406. const m___builtin_vsx_xxlandc = "__builtin_vec_andc"
  407. const m___builtin_vsx_xxlnor = "__builtin_vec_nor"
  408. const m___builtin_vsx_xxlor = "__builtin_vec_or"
  409. const m___builtin_vsx_xxlxor = "__builtin_vec_xor"
  410. const m___builtin_vsx_xxsel = "__builtin_vec_sel"
  411. const m___float128 = "__ieee128"
  412. const m___gnu_linux__ = 1
  413. const m___inline = "inline"
  414. const m___linux = 1
  415. const m___linux__ = 1
  416. const m___pic__ = 2
  417. const m___pie__ = 2
  418. const m___powerpc64__ = 1
  419. const m___powerpc__ = 1
  420. const m___restrict = "restrict"
  421. const m___restrict_arr = "restrict"
  422. const m___unix = 1
  423. const m___unix__ = 1
  424. const m_alloca = "__builtin_alloca"
  425. const m_linux = 1
  426. const m_unix = 1
  427. type t__builtin_va_list = uintptr
  428. type t__predefined_size_t = uint64
  429. type t__predefined_wchar_t = int32
  430. type t__predefined_ptrdiff_t = int64
  431. type TXauth = struct {
  432. Ffamily uint16
  433. Faddress_length uint16
  434. Faddress uintptr
  435. Fnumber_length uint16
  436. Fnumber uintptr
  437. Fname_length uint16
  438. Fname uintptr
  439. Fdata_length uint16
  440. Fdata uintptr
  441. }
  442. type Txauth = TXauth
  443. type Tsize_t = uint64
  444. type Tlocale_t = uintptr
  445. type Tssize_t = int64
  446. type Toff_t = int64
  447. type Tva_list = uintptr
  448. type t__isoc_va_list = uintptr
  449. type Tfpos_t = struct {
  450. F__lldata [0]int64
  451. F__align [0]float64
  452. F__opaque [16]uint8
  453. }
  454. type T_G_fpos64_t = Tfpos_t
  455. type Tcookie_io_functions_t = struct {
  456. Fread uintptr
  457. Fwrite uintptr
  458. Fseek uintptr
  459. Fclose1 uintptr
  460. }
  461. type T_IO_cookie_io_functions_t = Tcookie_io_functions_t
  462. type Twchar_t = int32
  463. type Tdiv_t = struct {
  464. Fquot int32
  465. Frem int32
  466. }
  467. type Tldiv_t = struct {
  468. Fquot int64
  469. Frem int64
  470. }
  471. type Tlldiv_t = struct {
  472. Fquot int64
  473. Frem int64
  474. }
  475. func XXauDisposeAuth(tls *libc.TLS, auth uintptr) {
  476. if auth != 0 {
  477. libc.Xfree(tls, (*TXauth)(unsafe.Pointer(auth)).Faddress)
  478. libc.Xfree(tls, (*TXauth)(unsafe.Pointer(auth)).Fnumber)
  479. libc.Xfree(tls, (*TXauth)(unsafe.Pointer(auth)).Fname)
  480. if (*TXauth)(unsafe.Pointer(auth)).Fdata != 0 {
  481. libc.Xmemset(tls, (*TXauth)(unsafe.Pointer(auth)).Fdata, 0, uint64((*TXauth)(unsafe.Pointer(auth)).Fdata_length))
  482. libc.Xfree(tls, (*TXauth)(unsafe.Pointer(auth)).Fdata)
  483. }
  484. libc.Xfree(tls, auth)
  485. }
  486. return
  487. }
  488. const m_AT_EACCESS = 0x200
  489. const m_AT_EMPTY_PATH = 0x1000
  490. const m_AT_NO_AUTOMOUNT = 0x800
  491. const m_AT_RECURSIVE = 0x8000
  492. const m_AT_REMOVEDIR = 0x200
  493. const m_AT_STATX_DONT_SYNC = 0x4000
  494. const m_AT_STATX_FORCE_SYNC = 0x2000
  495. const m_AT_STATX_SYNC_AS_STAT = 0x0000
  496. const m_AT_STATX_SYNC_TYPE = 0x6000
  497. const m_AT_SYMLINK_FOLLOW = 0x400
  498. const m_AT_SYMLINK_NOFOLLOW = 0x100
  499. const m_BIG_ENDIAN = "__BIG_ENDIAN"
  500. const m_BYTE_ORDER = "__BYTE_ORDER"
  501. const m_CLOCKS_PER_SEC = 1000000
  502. const m_CLOCK_BOOTTIME = 7
  503. const m_CLOCK_BOOTTIME_ALARM = 9
  504. const m_CLOCK_MONOTONIC = 1
  505. const m_CLOCK_MONOTONIC_COARSE = 6
  506. const m_CLOCK_MONOTONIC_RAW = 4
  507. const m_CLOCK_PROCESS_CPUTIME_ID = 2
  508. const m_CLOCK_REALTIME = 0
  509. const m_CLOCK_REALTIME_ALARM = 8
  510. const m_CLOCK_REALTIME_COARSE = 5
  511. const m_CLOCK_SGI_CYCLE = 10
  512. const m_CLOCK_TAI = 11
  513. const m_CLOCK_THREAD_CPUTIME_ID = 3
  514. const m_DN_ACCESS = 0x00000001
  515. const m_DN_ATTRIB = 0x00000020
  516. const m_DN_CREATE = 0x00000004
  517. const m_DN_DELETE = 0x00000008
  518. const m_DN_MODIFY = 0x00000002
  519. const m_DN_MULTISHOT = 0x80000000
  520. const m_DN_RENAME = 0x00000010
  521. const m_FALLOC_FL_KEEP_SIZE = 1
  522. const m_FALLOC_FL_PUNCH_HOLE = 2
  523. const m_FAPPEND = "O_APPEND"
  524. const m_FASYNC = "O_ASYNC"
  525. const m_FD_CLOEXEC = 1
  526. const m_FD_SETSIZE = 1024
  527. const m_FFSYNC = "O_SYNC"
  528. const m_FNDELAY = "O_NDELAY"
  529. const m_FNONBLOCK = "O_NONBLOCK"
  530. const m_F_ADD_SEALS = 1033
  531. const m_F_CANCELLK = 1029
  532. const m_F_DUPFD = 0
  533. const m_F_DUPFD_CLOEXEC = 1030
  534. const m_F_GETFD = 1
  535. const m_F_GETFL = 3
  536. const m_F_GETLEASE = 1025
  537. const m_F_GETLK = 5
  538. const m_F_GETOWN = 9
  539. const m_F_GETOWNER_UIDS = 17
  540. const m_F_GETOWN_EX = 16
  541. const m_F_GETPIPE_SZ = 1032
  542. const m_F_GETSIG = 11
  543. const m_F_GET_FILE_RW_HINT = 1037
  544. const m_F_GET_RW_HINT = 1035
  545. const m_F_GET_SEALS = 1034
  546. const m_F_LOCK = 1
  547. const m_F_NOTIFY = 1026
  548. const m_F_OFD_GETLK = 36
  549. const m_F_OFD_SETLK = 37
  550. const m_F_OFD_SETLKW = 38
  551. const m_F_OK = 0
  552. const m_F_OWNER_GID = 2
  553. const m_F_OWNER_PGRP = 2
  554. const m_F_OWNER_PID = 1
  555. const m_F_OWNER_TID = 0
  556. const m_F_RDLCK = 0
  557. const m_F_SEAL_FUTURE_WRITE = 0x0010
  558. const m_F_SEAL_GROW = 0x0004
  559. const m_F_SEAL_SEAL = 0x0001
  560. const m_F_SEAL_SHRINK = 0x0002
  561. const m_F_SEAL_WRITE = 0x0008
  562. const m_F_SETFD = 2
  563. const m_F_SETFL = 4
  564. const m_F_SETLEASE = 1024
  565. const m_F_SETLK = 6
  566. const m_F_SETLKW = 7
  567. const m_F_SETOWN = 8
  568. const m_F_SETOWN_EX = 15
  569. const m_F_SETPIPE_SZ = 1031
  570. const m_F_SETSIG = 10
  571. const m_F_SET_FILE_RW_HINT = 1038
  572. const m_F_SET_RW_HINT = 1036
  573. const m_F_TEST = 3
  574. const m_F_TLOCK = 2
  575. const m_F_ULOCK = 0
  576. const m_F_UNLCK = 2
  577. const m_F_WRLCK = 1
  578. const m_ITIMER_PROF = 2
  579. const m_ITIMER_REAL = 0
  580. const m_ITIMER_VIRTUAL = 1
  581. const m_LITTLE_ENDIAN = "__LITTLE_ENDIAN"
  582. const m_L_INCR = 1
  583. const m_L_SET = 0
  584. const m_L_XTND = 2
  585. const m_MAX_HANDLE_SZ = 128
  586. const m_O_APPEND = 02000
  587. const m_O_ASYNC = 020000
  588. const m_O_CLOEXEC = 02000000
  589. const m_O_CREAT = 0100
  590. const m_O_DIRECT = 0400000
  591. const m_O_DIRECTORY = 040000
  592. const m_O_DSYNC = 010000
  593. const m_O_EXCL = 0200
  594. const m_O_EXEC = "O_PATH"
  595. const m_O_LARGEFILE = 0200000
  596. const m_O_NDELAY = "O_NONBLOCK"
  597. const m_O_NOATIME = 01000000
  598. const m_O_NOCTTY = 0400
  599. const m_O_NOFOLLOW = 0100000
  600. const m_O_NONBLOCK = 04000
  601. const m_O_PATH = 010000000
  602. const m_O_RDONLY = 00
  603. const m_O_RDWR = 02
  604. const m_O_RSYNC = 04010000
  605. const m_O_SEARCH = "O_PATH"
  606. const m_O_SYNC = 04010000
  607. const m_O_TMPFILE = 020040000
  608. const m_O_TRUNC = 01000
  609. const m_O_TTY_INIT = 0
  610. const m_O_WRONLY = 01
  611. const m_PDP_ENDIAN = "__PDP_ENDIAN"
  612. const m_POSIX_CLOSE_RESTART = 0
  613. const m_POSIX_FADV_DONTNEED = 4
  614. const m_POSIX_FADV_NOREUSE = 5
  615. const m_POSIX_FADV_NORMAL = 0
  616. const m_POSIX_FADV_RANDOM = 1
  617. const m_POSIX_FADV_SEQUENTIAL = 2
  618. const m_POSIX_FADV_WILLNEED = 3
  619. const m_RWF_WRITE_LIFE_NOT_SET = 0
  620. const m_RWH_WRITE_LIFE_EXTREME = 5
  621. const m_RWH_WRITE_LIFE_LONG = 4
  622. const m_RWH_WRITE_LIFE_MEDIUM = 3
  623. const m_RWH_WRITE_LIFE_NONE = 1
  624. const m_RWH_WRITE_LIFE_SHORT = 2
  625. const m_R_OK = 4
  626. const m_SEEK_DATA = 3
  627. const m_SEEK_HOLE = 4
  628. const m_SPLICE_F_GIFT = 8
  629. const m_SPLICE_F_MORE = 4
  630. const m_SPLICE_F_MOVE = 1
  631. const m_SPLICE_F_NONBLOCK = 2
  632. const m_STDERR_FILENO = 2
  633. const m_STDIN_FILENO = 0
  634. const m_STDOUT_FILENO = 1
  635. const m_SYNC_FILE_RANGE_WAIT_AFTER = 4
  636. const m_SYNC_FILE_RANGE_WAIT_BEFORE = 1
  637. const m_SYNC_FILE_RANGE_WRITE = 2
  638. const m_S_IRGRP = 0040
  639. const m_S_IROTH = 0004
  640. const m_S_IRUSR = 0400
  641. const m_S_IRWXG = 0070
  642. const m_S_IRWXO = 0007
  643. const m_S_IRWXU = 0700
  644. const m_S_ISGID = 02000
  645. const m_S_ISUID = 04000
  646. const m_S_ISVTX = 01000
  647. const m_S_IWGRP = 0020
  648. const m_S_IWOTH = 0002
  649. const m_S_IWUSR = 0200
  650. const m_S_IXGRP = 0010
  651. const m_S_IXOTH = 0001
  652. const m_S_IXUSR = 0100
  653. const m_TIMER_ABSTIME = 1
  654. const m_TIME_UTC = 1
  655. const m_W_OK = 2
  656. const m_X_BIG_ENDIAN = "BIG_ENDIAN"
  657. const m_X_BYTE_ORDER = "BYTE_ORDER"
  658. const m_X_LITTLE_ENDIAN = "LITTLE_ENDIAN"
  659. const m_X_OK = 1
  660. const m__CS_GNU_LIBC_VERSION = 2
  661. const m__CS_GNU_LIBPTHREAD_VERSION = 3
  662. const m__CS_PATH = 0
  663. const m__CS_POSIX_V5_WIDTH_RESTRICTED_ENVS = 4
  664. const m__CS_POSIX_V6_ILP32_OFF32_CFLAGS = 1116
  665. const m__CS_POSIX_V6_ILP32_OFF32_LDFLAGS = 1117
  666. const m__CS_POSIX_V6_ILP32_OFF32_LIBS = 1118
  667. const m__CS_POSIX_V6_ILP32_OFF32_LINTFLAGS = 1119
  668. const m__CS_POSIX_V6_ILP32_OFFBIG_CFLAGS = 1120
  669. const m__CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS = 1121
  670. const m__CS_POSIX_V6_ILP32_OFFBIG_LIBS = 1122
  671. const m__CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS = 1123
  672. const m__CS_POSIX_V6_LP64_OFF64_CFLAGS = 1124
  673. const m__CS_POSIX_V6_LP64_OFF64_LDFLAGS = 1125
  674. const m__CS_POSIX_V6_LP64_OFF64_LIBS = 1126
  675. const m__CS_POSIX_V6_LP64_OFF64_LINTFLAGS = 1127
  676. const m__CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS = 1128
  677. const m__CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS = 1129
  678. const m__CS_POSIX_V6_LPBIG_OFFBIG_LIBS = 1130
  679. const m__CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS = 1131
  680. const m__CS_POSIX_V6_WIDTH_RESTRICTED_ENVS = 1
  681. const m__CS_POSIX_V7_ILP32_OFF32_CFLAGS = 1132
  682. const m__CS_POSIX_V7_ILP32_OFF32_LDFLAGS = 1133
  683. const m__CS_POSIX_V7_ILP32_OFF32_LIBS = 1134
  684. const m__CS_POSIX_V7_ILP32_OFF32_LINTFLAGS = 1135
  685. const m__CS_POSIX_V7_ILP32_OFFBIG_CFLAGS = 1136
  686. const m__CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS = 1137
  687. const m__CS_POSIX_V7_ILP32_OFFBIG_LIBS = 1138
  688. const m__CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS = 1139
  689. const m__CS_POSIX_V7_LP64_OFF64_CFLAGS = 1140
  690. const m__CS_POSIX_V7_LP64_OFF64_LDFLAGS = 1141
  691. const m__CS_POSIX_V7_LP64_OFF64_LIBS = 1142
  692. const m__CS_POSIX_V7_LP64_OFF64_LINTFLAGS = 1143
  693. const m__CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS = 1144
  694. const m__CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS = 1145
  695. const m__CS_POSIX_V7_LPBIG_OFFBIG_LIBS = 1146
  696. const m__CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS = 1147
  697. const m__CS_POSIX_V7_THREADS_CFLAGS = 1150
  698. const m__CS_POSIX_V7_THREADS_LDFLAGS = 1151
  699. const m__CS_POSIX_V7_WIDTH_RESTRICTED_ENVS = 5
  700. const m__CS_V6_ENV = 1148
  701. const m__CS_V7_ENV = 1149
  702. const m__PC_2_SYMLINKS = 20
  703. const m__PC_ALLOC_SIZE_MIN = 18
  704. const m__PC_ASYNC_IO = 10
  705. const m__PC_CHOWN_RESTRICTED = 6
  706. const m__PC_FILESIZEBITS = 13
  707. const m__PC_LINK_MAX = 0
  708. const m__PC_MAX_CANON = 1
  709. const m__PC_MAX_INPUT = 2
  710. const m__PC_NAME_MAX = 3
  711. const m__PC_NO_TRUNC = 7
  712. const m__PC_PATH_MAX = 4
  713. const m__PC_PIPE_BUF = 5
  714. const m__PC_PRIO_IO = 11
  715. const m__PC_REC_INCR_XFER_SIZE = 14
  716. const m__PC_REC_MAX_XFER_SIZE = 15
  717. const m__PC_REC_MIN_XFER_SIZE = 16
  718. const m__PC_REC_XFER_ALIGN = 17
  719. const m__PC_SOCK_MAXBUF = 12
  720. const m__PC_SYMLINK_MAX = 19
  721. const m__PC_SYNC_IO = 9
  722. const m__PC_VDISABLE = 8
  723. const m__POSIX2_C_BIND = "_POSIX_VERSION"
  724. const m__POSIX2_VERSION = "_POSIX_VERSION"
  725. const m__POSIX_ADVISORY_INFO = "_POSIX_VERSION"
  726. const m__POSIX_ASYNCHRONOUS_IO = "_POSIX_VERSION"
  727. const m__POSIX_BARRIERS = "_POSIX_VERSION"
  728. const m__POSIX_CHOWN_RESTRICTED = 1
  729. const m__POSIX_CLOCK_SELECTION = "_POSIX_VERSION"
  730. const m__POSIX_CPUTIME = "_POSIX_VERSION"
  731. const m__POSIX_FSYNC = "_POSIX_VERSION"
  732. const m__POSIX_IPV6 = "_POSIX_VERSION"
  733. const m__POSIX_JOB_CONTROL = 1
  734. const m__POSIX_MAPPED_FILES = "_POSIX_VERSION"
  735. const m__POSIX_MEMLOCK = "_POSIX_VERSION"
  736. const m__POSIX_MEMLOCK_RANGE = "_POSIX_VERSION"
  737. const m__POSIX_MEMORY_PROTECTION = "_POSIX_VERSION"
  738. const m__POSIX_MESSAGE_PASSING = "_POSIX_VERSION"
  739. const m__POSIX_MONOTONIC_CLOCK = "_POSIX_VERSION"
  740. const m__POSIX_NO_TRUNC = 1
  741. const m__POSIX_RAW_SOCKETS = "_POSIX_VERSION"
  742. const m__POSIX_READER_WRITER_LOCKS = "_POSIX_VERSION"
  743. const m__POSIX_REALTIME_SIGNALS = "_POSIX_VERSION"
  744. const m__POSIX_REGEXP = 1
  745. const m__POSIX_SAVED_IDS = 1
  746. const m__POSIX_SEMAPHORES = "_POSIX_VERSION"
  747. const m__POSIX_SHARED_MEMORY_OBJECTS = "_POSIX_VERSION"
  748. const m__POSIX_SHELL = 1
  749. const m__POSIX_SPAWN = "_POSIX_VERSION"
  750. const m__POSIX_SPIN_LOCKS = "_POSIX_VERSION"
  751. const m__POSIX_THREADS = "_POSIX_VERSION"
  752. const m__POSIX_THREAD_ATTR_STACKADDR = "_POSIX_VERSION"
  753. const m__POSIX_THREAD_ATTR_STACKSIZE = "_POSIX_VERSION"
  754. const m__POSIX_THREAD_CPUTIME = "_POSIX_VERSION"
  755. const m__POSIX_THREAD_PRIORITY_SCHEDULING = "_POSIX_VERSION"
  756. const m__POSIX_THREAD_PROCESS_SHARED = "_POSIX_VERSION"
  757. const m__POSIX_THREAD_SAFE_FUNCTIONS = "_POSIX_VERSION"
  758. const m__POSIX_TIMEOUTS = "_POSIX_VERSION"
  759. const m__POSIX_TIMERS = "_POSIX_VERSION"
  760. const m__POSIX_V6_LP64_OFF64 = 1
  761. const m__POSIX_V7_LP64_OFF64 = 1
  762. const m__POSIX_VDISABLE = 0
  763. const m__POSIX_VERSION = 200809
  764. const m__SC_2_CHAR_TERM = 95
  765. const m__SC_2_C_BIND = 47
  766. const m__SC_2_C_DEV = 48
  767. const m__SC_2_FORT_DEV = 49
  768. const m__SC_2_FORT_RUN = 50
  769. const m__SC_2_LOCALEDEF = 52
  770. const m__SC_2_PBS = 168
  771. const m__SC_2_PBS_ACCOUNTING = 169
  772. const m__SC_2_PBS_CHECKPOINT = 175
  773. const m__SC_2_PBS_LOCATE = 170
  774. const m__SC_2_PBS_MESSAGE = 171
  775. const m__SC_2_PBS_TRACK = 172
  776. const m__SC_2_SW_DEV = 51
  777. const m__SC_2_UPE = 97
  778. const m__SC_2_VERSION = 46
  779. const m__SC_ADVISORY_INFO = 132
  780. const m__SC_AIO_LISTIO_MAX = 23
  781. const m__SC_AIO_MAX = 24
  782. const m__SC_AIO_PRIO_DELTA_MAX = 25
  783. const m__SC_ARG_MAX = 0
  784. const m__SC_ASYNCHRONOUS_IO = 12
  785. const m__SC_ATEXIT_MAX = 87
  786. const m__SC_AVPHYS_PAGES = 86
  787. const m__SC_BARRIERS = 133
  788. const m__SC_BC_BASE_MAX = 36
  789. const m__SC_BC_DIM_MAX = 37
  790. const m__SC_BC_SCALE_MAX = 38
  791. const m__SC_BC_STRING_MAX = 39
  792. const m__SC_CHILD_MAX = 1
  793. const m__SC_CLK_TCK = 2
  794. const m__SC_CLOCK_SELECTION = 137
  795. const m__SC_COLL_WEIGHTS_MAX = 40
  796. const m__SC_CPUTIME = 138
  797. const m__SC_DELAYTIMER_MAX = 26
  798. const m__SC_EXPR_NEST_MAX = 42
  799. const m__SC_FSYNC = 15
  800. const m__SC_GETGR_R_SIZE_MAX = 69
  801. const m__SC_GETPW_R_SIZE_MAX = 70
  802. const m__SC_HOST_NAME_MAX = 180
  803. const m__SC_IOV_MAX = 60
  804. const m__SC_IPV6 = 235
  805. const m__SC_JOB_CONTROL = 7
  806. const m__SC_LINE_MAX = 43
  807. const m__SC_LOGIN_NAME_MAX = 71
  808. const m__SC_MAPPED_FILES = 16
  809. const m__SC_MEMLOCK = 17
  810. const m__SC_MEMLOCK_RANGE = 18
  811. const m__SC_MEMORY_PROTECTION = 19
  812. const m__SC_MESSAGE_PASSING = 20
  813. const m__SC_MINSIGSTKSZ = 249
  814. const m__SC_MONOTONIC_CLOCK = 149
  815. const m__SC_MQ_OPEN_MAX = 27
  816. const m__SC_MQ_PRIO_MAX = 28
  817. const m__SC_NGROUPS_MAX = 3
  818. const m__SC_NPROCESSORS_CONF = 83
  819. const m__SC_NPROCESSORS_ONLN = 84
  820. const m__SC_NZERO = 109
  821. const m__SC_OPEN_MAX = 4
  822. const m__SC_PAGESIZE = 30
  823. const m__SC_PAGE_SIZE = 30
  824. const m__SC_PASS_MAX = 88
  825. const m__SC_PHYS_PAGES = 85
  826. const m__SC_PRIORITIZED_IO = 13
  827. const m__SC_PRIORITY_SCHEDULING = 10
  828. const m__SC_RAW_SOCKETS = 236
  829. const m__SC_READER_WRITER_LOCKS = 153
  830. const m__SC_REALTIME_SIGNALS = 9
  831. const m__SC_REGEXP = 155
  832. const m__SC_RE_DUP_MAX = 44
  833. const m__SC_RTSIG_MAX = 31
  834. const m__SC_SAVED_IDS = 8
  835. const m__SC_SEMAPHORES = 21
  836. const m__SC_SEM_NSEMS_MAX = 32
  837. const m__SC_SEM_VALUE_MAX = 33
  838. const m__SC_SHARED_MEMORY_OBJECTS = 22
  839. const m__SC_SHELL = 157
  840. const m__SC_SIGQUEUE_MAX = 34
  841. const m__SC_SIGSTKSZ = 250
  842. const m__SC_SPAWN = 159
  843. const m__SC_SPIN_LOCKS = 154
  844. const m__SC_SPORADIC_SERVER = 160
  845. const m__SC_SS_REPL_MAX = 241
  846. const m__SC_STREAMS = 174
  847. const m__SC_STREAM_MAX = 5
  848. const m__SC_SYMLOOP_MAX = 173
  849. const m__SC_SYNCHRONIZED_IO = 14
  850. const m__SC_THREADS = 67
  851. const m__SC_THREAD_ATTR_STACKADDR = 77
  852. const m__SC_THREAD_ATTR_STACKSIZE = 78
  853. const m__SC_THREAD_CPUTIME = 139
  854. const m__SC_THREAD_DESTRUCTOR_ITERATIONS = 73
  855. const m__SC_THREAD_KEYS_MAX = 74
  856. const m__SC_THREAD_PRIORITY_SCHEDULING = 79
  857. const m__SC_THREAD_PRIO_INHERIT = 80
  858. const m__SC_THREAD_PRIO_PROTECT = 81
  859. const m__SC_THREAD_PROCESS_SHARED = 82
  860. const m__SC_THREAD_ROBUST_PRIO_INHERIT = 247
  861. const m__SC_THREAD_ROBUST_PRIO_PROTECT = 248
  862. const m__SC_THREAD_SAFE_FUNCTIONS = 68
  863. const m__SC_THREAD_SPORADIC_SERVER = 161
  864. const m__SC_THREAD_STACK_MIN = 75
  865. const m__SC_THREAD_THREADS_MAX = 76
  866. const m__SC_TIMEOUTS = 164
  867. const m__SC_TIMERS = 11
  868. const m__SC_TIMER_MAX = 35
  869. const m__SC_TRACE = 181
  870. const m__SC_TRACE_EVENT_FILTER = 182
  871. const m__SC_TRACE_EVENT_NAME_MAX = 242
  872. const m__SC_TRACE_INHERIT = 183
  873. const m__SC_TRACE_LOG = 184
  874. const m__SC_TRACE_NAME_MAX = 243
  875. const m__SC_TRACE_SYS_MAX = 244
  876. const m__SC_TRACE_USER_EVENT_MAX = 245
  877. const m__SC_TTY_NAME_MAX = 72
  878. const m__SC_TYPED_MEMORY_OBJECTS = 165
  879. const m__SC_TZNAME_MAX = 6
  880. const m__SC_UIO_MAXIOV = 60
  881. const m__SC_V6_ILP32_OFF32 = 176
  882. const m__SC_V6_ILP32_OFFBIG = 177
  883. const m__SC_V6_LP64_OFF64 = 178
  884. const m__SC_V6_LPBIG_OFFBIG = 179
  885. const m__SC_V7_ILP32_OFF32 = 237
  886. const m__SC_V7_ILP32_OFFBIG = 238
  887. const m__SC_V7_LP64_OFF64 = 239
  888. const m__SC_V7_LPBIG_OFFBIG = 240
  889. const m__SC_VERSION = 29
  890. const m__SC_XBS5_ILP32_OFF32 = 125
  891. const m__SC_XBS5_ILP32_OFFBIG = 126
  892. const m__SC_XBS5_LP64_OFF64 = 127
  893. const m__SC_XBS5_LPBIG_OFFBIG = 128
  894. const m__SC_XOPEN_CRYPT = 92
  895. const m__SC_XOPEN_ENH_I18N = 93
  896. const m__SC_XOPEN_LEGACY = 129
  897. const m__SC_XOPEN_REALTIME = 130
  898. const m__SC_XOPEN_REALTIME_THREADS = 131
  899. const m__SC_XOPEN_SHM = 94
  900. const m__SC_XOPEN_STREAMS = 246
  901. const m__SC_XOPEN_UNIX = 91
  902. const m__SC_XOPEN_VERSION = 89
  903. const m__SC_XOPEN_XCU_VERSION = 90
  904. const m__SC_XOPEN_XPG2 = 98
  905. const m__SC_XOPEN_XPG3 = 99
  906. const m__SC_XOPEN_XPG4 = 100
  907. const m__XOPEN_ENH_I18N = 1
  908. const m__XOPEN_UNIX = 1
  909. const m__XOPEN_VERSION = 700
  910. const m___PDP_ENDIAN = 3412
  911. const m___tm_gmtoff = "tm_gmtoff"
  912. const m___tm_zone = "tm_zone"
  913. const m_loff_t = "off_t"
  914. const m_static_assert = "_Static_assert"
  915. type Tregister_t = int64
  916. type Ttime_t = int64
  917. type Tsuseconds_t = int64
  918. type Tint8_t = int8
  919. type Tint16_t = int16
  920. type Tint32_t = int32
  921. type Tint64_t = int64
  922. type Tu_int64_t = uint64
  923. type Tmode_t = uint32
  924. type Tnlink_t = uint64
  925. type Tino_t = uint64
  926. type Tdev_t = uint64
  927. type Tblksize_t = int64
  928. type Tblkcnt_t = int64
  929. type Tfsblkcnt_t = uint64
  930. type Tfsfilcnt_t = uint64
  931. type Ttimer_t = uintptr
  932. type Tclockid_t = int32
  933. type Tclock_t = int64
  934. type Tpid_t = int32
  935. type Tid_t = uint32
  936. type Tuid_t = uint32
  937. type Tgid_t = uint32
  938. type Tkey_t = int32
  939. type Tuseconds_t = uint32
  940. type Tpthread_t = uintptr
  941. type Tpthread_once_t = int32
  942. type Tpthread_key_t = uint32
  943. type Tpthread_spinlock_t = int32
  944. type Tpthread_mutexattr_t = struct {
  945. F__attr uint32
  946. }
  947. type Tpthread_condattr_t = struct {
  948. F__attr uint32
  949. }
  950. type Tpthread_barrierattr_t = struct {
  951. F__attr uint32
  952. }
  953. type Tpthread_rwlockattr_t = struct {
  954. F__attr [2]uint32
  955. }
  956. type Tpthread_attr_t = struct {
  957. F__u struct {
  958. F__vi [0][14]int32
  959. F__s [0][7]uint64
  960. F__i [14]int32
  961. }
  962. }
  963. type Tpthread_mutex_t = struct {
  964. F__u struct {
  965. F__vi [0][10]int32
  966. F__p [0][5]uintptr
  967. F__i [10]int32
  968. }
  969. }
  970. type Tpthread_cond_t = struct {
  971. F__u struct {
  972. F__vi [0][12]int32
  973. F__p [0][6]uintptr
  974. F__i [12]int32
  975. }
  976. }
  977. type Tpthread_rwlock_t = struct {
  978. F__u struct {
  979. F__vi [0][14]int32
  980. F__p [0][7]uintptr
  981. F__i [14]int32
  982. }
  983. }
  984. type Tpthread_barrier_t = struct {
  985. F__u struct {
  986. F__vi [0][8]int32
  987. F__p [0][4]uintptr
  988. F__i [8]int32
  989. }
  990. }
  991. type Tu_int8_t = uint8
  992. type Tu_int16_t = uint16
  993. type Tu_int32_t = uint32
  994. type Tcaddr_t = uintptr
  995. type Tu_char = uint8
  996. type Tu_short = uint16
  997. type Tushort = uint16
  998. type Tu_int = uint32
  999. type Tuint = uint32
  1000. type Tu_long = uint64
  1001. type Tulong = uint64
  1002. type Tquad_t = int64
  1003. type Tu_quad_t = uint64
  1004. type Tuint16_t = uint16
  1005. type Tuint32_t = uint32
  1006. type Tuint64_t = uint64
  1007. type Ttimeval = struct {
  1008. Ftv_sec Ttime_t
  1009. Ftv_usec Tsuseconds_t
  1010. }
  1011. type Ttimespec = struct {
  1012. Ftv_sec Ttime_t
  1013. Ftv_nsec int64
  1014. }
  1015. type Tsigset_t = struct {
  1016. F__bits [16]uint64
  1017. }
  1018. type t__sigset_t = Tsigset_t
  1019. type Tfd_mask = uint64
  1020. type Tfd_set = struct {
  1021. Ffds_bits [16]uint64
  1022. }
  1023. type Tiovec = struct {
  1024. Fiov_base uintptr
  1025. Fiov_len Tsize_t
  1026. }
  1027. type Tflock = struct {
  1028. Fl_type int16
  1029. Fl_whence int16
  1030. Fl_start Toff_t
  1031. Fl_len Toff_t
  1032. Fl_pid Tpid_t
  1033. }
  1034. type Tfile_handle = struct {
  1035. Fhandle_bytes uint32
  1036. Fhandle_type int32
  1037. }
  1038. type Tf_owner_ex = struct {
  1039. Ftype1 int32
  1040. Fpid Tpid_t
  1041. }
  1042. type Tintptr_t = int64
  1043. type Titimerval = struct {
  1044. Fit_interval Ttimeval
  1045. Fit_value Ttimeval
  1046. }
  1047. type Ttimezone = struct {
  1048. Ftz_minuteswest int32
  1049. Ftz_dsttime int32
  1050. }
  1051. type Ttm = struct {
  1052. Ftm_sec int32
  1053. Ftm_min int32
  1054. Ftm_hour int32
  1055. Ftm_mday int32
  1056. Ftm_mon int32
  1057. Ftm_year int32
  1058. Ftm_wday int32
  1059. Ftm_yday int32
  1060. Ftm_isdst int32
  1061. Ftm_gmtoff int64
  1062. Ftm_zone uintptr
  1063. }
  1064. type Titimerspec = struct {
  1065. Fit_interval Ttimespec
  1066. Fit_value Ttimespec
  1067. }
  1068. var _buf = libc.UintptrFromInt32(0)
  1069. func _free_filename_buffer(tls *libc.TLS) {
  1070. libc.Xfree(tls, _buf)
  1071. _buf = libc.UintptrFromInt32(0)
  1072. }
  1073. func XXauFileName(tls *libc.TLS) (r uintptr) {
  1074. bp := tls.Alloc(32)
  1075. defer tls.Free(32)
  1076. var name, slashDotXauthority, v1 uintptr
  1077. var size Tsize_t
  1078. var v2 int32
  1079. _, _, _, _, _ = name, size, slashDotXauthority, v1, v2
  1080. slashDotXauthority = __ccgo_ts
  1081. v1 = libc.Xgetenv(tls, __ccgo_ts+13)
  1082. name = v1
  1083. if v1 != 0 {
  1084. return name
  1085. }
  1086. name = libc.Xgetenv(tls, __ccgo_ts+24)
  1087. if !(name != 0) {
  1088. return libc.UintptrFromInt32(0)
  1089. }
  1090. size = libc.Xstrlen(tls, name) + libc.Xstrlen(tls, slashDotXauthority+1) + uint64(2)
  1091. if size > _bsize || _buf == libc.UintptrFromInt32(0) {
  1092. libc.Xfree(tls, _buf)
  1093. _buf = libc.Xmalloc(tls, size)
  1094. if !(_buf != 0) {
  1095. _bsize = uint64(0)
  1096. return libc.UintptrFromInt32(0)
  1097. }
  1098. if !(_atexit_registered != 0) {
  1099. libc.Xatexit(tls, __ccgo_fp(_free_filename_buffer))
  1100. _atexit_registered = int32(1)
  1101. }
  1102. _bsize = size
  1103. }
  1104. if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(name))) == int32('/') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(name + 1))) == int32('\000') {
  1105. v2 = int32(1)
  1106. } else {
  1107. v2 = 0
  1108. }
  1109. libc.X__builtin_snprintf(tls, _buf, _bsize, __ccgo_ts+29, libc.VaList(bp+8, name, slashDotXauthority+uintptr(v2)))
  1110. return _buf
  1111. }
  1112. var _bsize Tsize_t
  1113. var _atexit_registered int32
  1114. /* define X_GETTIMEOFDAY macro, a portable gettimeofday() */
  1115. /* use POSIX name for signal */
  1116. /*
  1117. * Copyright 1997 Metro Link Incorporated
  1118. *
  1119. * All Rights Reserved
  1120. *
  1121. * Permission to use, copy, modify, distribute, and sell this software and its
  1122. * documentation for any purpose is hereby granted without fee, provided that
  1123. * the above copyright notice appear in all copies and that both that
  1124. * copyright notice and this permission notice appear in supporting
  1125. * documentation, and that the names of the above listed copyright holder(s)
  1126. * not be used in advertising or publicity pertaining to distribution of
  1127. * the software without specific, written prior permission. The above listed
  1128. * copyright holder(s) make(s) no representations about the suitability of
  1129. * this software for any purpose. It is provided "as is" without express or
  1130. * implied warranty.
  1131. *
  1132. * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD
  1133. * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  1134. * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
  1135. * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
  1136. * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
  1137. * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
  1138. * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  1139. */
  1140. /*
  1141. * Determine the machine's byte order.
  1142. */
  1143. /* See if it is set in the imake config first */
  1144. /* 'endian.h' might have been included before 'Xarch.h' */
  1145. func XXauGetAuthByAddr(tls *libc.TLS, family uint16, address_length uint16, address uintptr, number_length uint16, number uintptr, name_length uint16, name uintptr) (r uintptr) {
  1146. var auth_file, auth_name, entry uintptr
  1147. _, _, _ = auth_file, auth_name, entry
  1148. auth_name = XXauFileName(tls)
  1149. if !(auth_name != 0) {
  1150. return libc.UintptrFromInt32(0)
  1151. }
  1152. if libc.Xaccess(tls, auth_name, int32(m_R_OK)) != 0 { /* checks REAL id */
  1153. return libc.UintptrFromInt32(0)
  1154. }
  1155. auth_file = libc.Xfopen(tls, auth_name, __ccgo_ts+34)
  1156. if !(auth_file != 0) {
  1157. return libc.UintptrFromInt32(0)
  1158. }
  1159. for {
  1160. entry = XXauReadAuth(tls, auth_file)
  1161. if !(entry != 0) {
  1162. break
  1163. }
  1164. /*
  1165. * Match when:
  1166. * either family or entry->family are FamilyWild or
  1167. * family and entry->family are the same and
  1168. * address and entry->address are the same
  1169. * and
  1170. * either number or entry->number are empty or
  1171. * number and entry->number are the same
  1172. * and
  1173. * either name or entry->name are empty or
  1174. * name and entry->name are the same
  1175. */
  1176. if (libc.Int32FromUint16(family) == int32(m_FamilyWild) || libc.Int32FromUint16((*TXauth)(unsafe.Pointer(entry)).Ffamily) == int32(m_FamilyWild) || libc.Int32FromUint16((*TXauth)(unsafe.Pointer(entry)).Ffamily) == libc.Int32FromUint16(family) && libc.Int32FromUint16(address_length) == libc.Int32FromUint16((*TXauth)(unsafe.Pointer(entry)).Faddress_length) && libc.Xmemcmp(tls, (*TXauth)(unsafe.Pointer(entry)).Faddress, address, uint64(address_length)) == 0) && (libc.Int32FromUint16(number_length) == 0 || libc.Int32FromUint16((*TXauth)(unsafe.Pointer(entry)).Fnumber_length) == 0 || libc.Int32FromUint16(number_length) == libc.Int32FromUint16((*TXauth)(unsafe.Pointer(entry)).Fnumber_length) && libc.Xmemcmp(tls, (*TXauth)(unsafe.Pointer(entry)).Fnumber, number, uint64(number_length)) == 0) && (libc.Int32FromUint16(name_length) == 0 || libc.Int32FromUint16((*TXauth)(unsafe.Pointer(entry)).Fname_length) == 0 || libc.Int32FromUint16((*TXauth)(unsafe.Pointer(entry)).Fname_length) == libc.Int32FromUint16(name_length) && libc.Xmemcmp(tls, (*TXauth)(unsafe.Pointer(entry)).Fname, name, uint64(name_length)) == 0) {
  1177. break
  1178. }
  1179. XXauDisposeAuth(tls, entry)
  1180. goto _1
  1181. _1:
  1182. }
  1183. libc.Xfclose(tls, auth_file)
  1184. return entry
  1185. }
  1186. const m_CLONE_CHILD_CLEARTID = 0x00200000
  1187. const m_CLONE_CHILD_SETTID = 0x01000000
  1188. const m_CLONE_DETACHED = 0x00400000
  1189. const m_CLONE_FILES = 0x00000400
  1190. const m_CLONE_FS = 0x00000200
  1191. const m_CLONE_IO = 0x80000000
  1192. const m_CLONE_NEWCGROUP = 0x02000000
  1193. const m_CLONE_NEWIPC = 0x08000000
  1194. const m_CLONE_NEWNET = 0x40000000
  1195. const m_CLONE_NEWNS = 0x00020000
  1196. const m_CLONE_NEWPID = 0x20000000
  1197. const m_CLONE_NEWTIME = 0x00000080
  1198. const m_CLONE_NEWUSER = 0x10000000
  1199. const m_CLONE_NEWUTS = 0x04000000
  1200. const m_CLONE_PARENT = 0x00008000
  1201. const m_CLONE_PARENT_SETTID = 0x00100000
  1202. const m_CLONE_PIDFD = 0x00001000
  1203. const m_CLONE_PTRACE = 0x00002000
  1204. const m_CLONE_SETTLS = 0x00080000
  1205. const m_CLONE_SIGHAND = 0x00000800
  1206. const m_CLONE_SYSVSEM = 0x00040000
  1207. const m_CLONE_THREAD = 0x00010000
  1208. const m_CLONE_UNTRACED = 0x00800000
  1209. const m_CLONE_VFORK = 0x00004000
  1210. const m_CLONE_VM = 0x00000100
  1211. const m_CPU_SETSIZE = 1024
  1212. const m_CSIGNAL = 0x000000ff
  1213. const m_PTHREAD_CANCEL_ASYNCHRONOUS = 1
  1214. const m_PTHREAD_CANCEL_DEFERRED = 0
  1215. const m_PTHREAD_CANCEL_DISABLE = 1
  1216. const m_PTHREAD_CANCEL_ENABLE = 0
  1217. const m_PTHREAD_CANCEL_MASKED = 2
  1218. const m_PTHREAD_CREATE_DETACHED = 1
  1219. const m_PTHREAD_CREATE_JOINABLE = 0
  1220. const m_PTHREAD_EXPLICIT_SCHED = 1
  1221. const m_PTHREAD_INHERIT_SCHED = 0
  1222. const m_PTHREAD_MUTEX_DEFAULT = 0
  1223. const m_PTHREAD_MUTEX_ERRORCHECK = 2
  1224. const m_PTHREAD_MUTEX_NORMAL = 0
  1225. const m_PTHREAD_MUTEX_RECURSIVE = 1
  1226. const m_PTHREAD_MUTEX_ROBUST = 1
  1227. const m_PTHREAD_MUTEX_STALLED = 0
  1228. const m_PTHREAD_ONCE_INIT = 0
  1229. const m_PTHREAD_PRIO_INHERIT = 1
  1230. const m_PTHREAD_PRIO_NONE = 0
  1231. const m_PTHREAD_PRIO_PROTECT = 2
  1232. const m_PTHREAD_PROCESS_PRIVATE = 0
  1233. const m_PTHREAD_PROCESS_SHARED = 1
  1234. const m_PTHREAD_SCOPE_PROCESS = 1
  1235. const m_PTHREAD_SCOPE_SYSTEM = 0
  1236. const m_SCHED_BATCH = 3
  1237. const m_SCHED_DEADLINE = 6
  1238. const m_SCHED_FIFO = 1
  1239. const m_SCHED_IDLE = 5
  1240. const m_SCHED_OTHER = 0
  1241. const m_SCHED_RESET_ON_FORK = 0x40000000
  1242. const m_SCHED_RR = 2
  1243. const m_XMUTEX_INITIALIZER = "PTHREAD_MUTEX_INITIALIZER"
  1244. const m_xfree = "free"
  1245. const m_xmalloc = "malloc"
  1246. const m_xthread_self = "pthread_self"
  1247. type Tsched_param = struct {
  1248. Fsched_priority int32
  1249. F__reserved1 int32
  1250. F__reserved2 [2]struct {
  1251. F__reserved1 Ttime_t
  1252. F__reserved2 int64
  1253. }
  1254. F__reserved3 int32
  1255. }
  1256. type Tcpu_set_t = struct {
  1257. F__bits [16]uint64
  1258. }
  1259. type t__ptcb = struct {
  1260. F__f uintptr
  1261. F__x uintptr
  1262. F__next uintptr
  1263. }
  1264. type Tcpu_set_t1 = struct {
  1265. F__bits [16]uint64
  1266. }
  1267. type Txthread_t = uintptr
  1268. type Txthread_key_t = uint32
  1269. type Txcondition_rec = struct {
  1270. F__u struct {
  1271. F__vi [0][12]int32
  1272. F__p [0][6]uintptr
  1273. F__i [12]int32
  1274. }
  1275. }
  1276. type Txmutex_rec = struct {
  1277. F__u struct {
  1278. F__vi [0][10]int32
  1279. F__p [0][5]uintptr
  1280. F__i [10]int32
  1281. }
  1282. }
  1283. type Txcondition_t = uintptr
  1284. type Txmutex_t = uintptr
  1285. /* aids understood by some debuggers */
  1286. func XXauGetBestAuthByAddr(tls *libc.TLS, family uint16, address_length uint16, address uintptr, number_length uint16, number uintptr, types_length int32, types uintptr, type_lengths uintptr) (r uintptr) {
  1287. var auth_file, auth_name, best, entry uintptr
  1288. var best_type, type1 int32
  1289. _, _, _, _, _, _ = auth_file, auth_name, best, best_type, entry, type1
  1290. auth_name = XXauFileName(tls)
  1291. if !(auth_name != 0) {
  1292. return libc.UintptrFromInt32(0)
  1293. }
  1294. if libc.Xaccess(tls, auth_name, int32(m_R_OK)) != 0 { /* checks REAL id */
  1295. return libc.UintptrFromInt32(0)
  1296. }
  1297. auth_file = libc.Xfopen(tls, auth_name, __ccgo_ts+34)
  1298. if !(auth_file != 0) {
  1299. return libc.UintptrFromInt32(0)
  1300. }
  1301. best = libc.UintptrFromInt32(0)
  1302. best_type = types_length
  1303. for {
  1304. entry = XXauReadAuth(tls, auth_file)
  1305. if !(entry != 0) {
  1306. break
  1307. }
  1308. /*
  1309. * Match when:
  1310. * either family or entry->family are FamilyWild or
  1311. * family and entry->family are the same and
  1312. * address and entry->address are the same
  1313. * and
  1314. * either number or entry->number are empty or
  1315. * number and entry->number are the same
  1316. * and
  1317. * either name or entry->name are empty or
  1318. * name and entry->name are the same
  1319. */
  1320. if (libc.Int32FromUint16(family) == int32(m_FamilyWild) || libc.Int32FromUint16((*TXauth)(unsafe.Pointer(entry)).Ffamily) == int32(m_FamilyWild) || libc.Int32FromUint16((*TXauth)(unsafe.Pointer(entry)).Ffamily) == libc.Int32FromUint16(family) && (libc.Int32FromUint16(address_length) == libc.Int32FromUint16((*TXauth)(unsafe.Pointer(entry)).Faddress_length) && libc.Xmemcmp(tls, (*TXauth)(unsafe.Pointer(entry)).Faddress, address, uint64(address_length)) == 0)) && (libc.Int32FromUint16(number_length) == 0 || libc.Int32FromUint16((*TXauth)(unsafe.Pointer(entry)).Fnumber_length) == 0 || libc.Int32FromUint16(number_length) == libc.Int32FromUint16((*TXauth)(unsafe.Pointer(entry)).Fnumber_length) && libc.Xmemcmp(tls, (*TXauth)(unsafe.Pointer(entry)).Fnumber, number, uint64(number_length)) == 0) {
  1321. if best_type == 0 {
  1322. best = entry
  1323. break
  1324. }
  1325. type1 = 0
  1326. for {
  1327. if !(type1 < best_type) {
  1328. break
  1329. }
  1330. if *(*int32)(unsafe.Pointer(type_lengths + uintptr(type1)*4)) == libc.Int32FromUint16((*TXauth)(unsafe.Pointer(entry)).Fname_length) && !(libc.Xstrncmp(tls, *(*uintptr)(unsafe.Pointer(types + uintptr(type1)*8)), (*TXauth)(unsafe.Pointer(entry)).Fname, uint64((*TXauth)(unsafe.Pointer(entry)).Fname_length)) != 0) {
  1331. break
  1332. }
  1333. goto _2
  1334. _2:
  1335. ;
  1336. type1++
  1337. }
  1338. if type1 < best_type {
  1339. if best != 0 {
  1340. XXauDisposeAuth(tls, best)
  1341. }
  1342. best = entry
  1343. best_type = type1
  1344. if type1 == 0 {
  1345. break
  1346. }
  1347. goto _1
  1348. }
  1349. }
  1350. XXauDisposeAuth(tls, entry)
  1351. goto _1
  1352. _1:
  1353. }
  1354. libc.Xfclose(tls, auth_file)
  1355. return best
  1356. }
  1357. const m_E2BIG = 7
  1358. const m_EACCES = 13
  1359. const m_EADDRINUSE = 98
  1360. const m_EADDRNOTAVAIL = 99
  1361. const m_EADV = 68
  1362. const m_EAFNOSUPPORT = 97
  1363. const m_EAGAIN = 11
  1364. const m_EALREADY = 114
  1365. const m_EBADE = 52
  1366. const m_EBADF = 9
  1367. const m_EBADFD = 77
  1368. const m_EBADMSG = 74
  1369. const m_EBADR = 53
  1370. const m_EBADRQC = 56
  1371. const m_EBADSLT = 57
  1372. const m_EBFONT = 59
  1373. const m_EBUSY = 16
  1374. const m_ECANCELED = 125
  1375. const m_ECHILD = 10
  1376. const m_ECHRNG = 44
  1377. const m_ECOMM = 70
  1378. const m_ECONNABORTED = 103
  1379. const m_ECONNREFUSED = 111
  1380. const m_ECONNRESET = 104
  1381. const m_EDEADLK = 35
  1382. const m_EDEADLOCK = 58
  1383. const m_EDESTADDRREQ = 89
  1384. const m_EDOM = 33
  1385. const m_EDOTDOT = 73
  1386. const m_EDQUOT = 122
  1387. const m_EEXIST = 17
  1388. const m_EFAULT = 14
  1389. const m_EFBIG = 27
  1390. const m_EHOSTDOWN = 112
  1391. const m_EHOSTUNREACH = 113
  1392. const m_EHWPOISON = 133
  1393. const m_EIDRM = 43
  1394. const m_EILSEQ = 84
  1395. const m_EINPROGRESS = 115
  1396. const m_EINTR = 4
  1397. const m_EINVAL = 22
  1398. const m_EIO = 5
  1399. const m_EISCONN = 106
  1400. const m_EISDIR = 21
  1401. const m_EISNAM = 120
  1402. const m_EKEYEXPIRED = 127
  1403. const m_EKEYREJECTED = 129
  1404. const m_EKEYREVOKED = 128
  1405. const m_EL2HLT = 51
  1406. const m_EL2NSYNC = 45
  1407. const m_EL3HLT = 46
  1408. const m_EL3RST = 47
  1409. const m_ELIBACC = 79
  1410. const m_ELIBBAD = 80
  1411. const m_ELIBEXEC = 83
  1412. const m_ELIBMAX = 82
  1413. const m_ELIBSCN = 81
  1414. const m_ELNRNG = 48
  1415. const m_ELOOP = 40
  1416. const m_EMEDIUMTYPE = 124
  1417. const m_EMFILE = 24
  1418. const m_EMLINK = 31
  1419. const m_EMSGSIZE = 90
  1420. const m_EMULTIHOP = 72
  1421. const m_ENAMETOOLONG = 36
  1422. const m_ENAVAIL = 119
  1423. const m_ENETDOWN = 100
  1424. const m_ENETRESET = 102
  1425. const m_ENETUNREACH = 101
  1426. const m_ENFILE = 23
  1427. const m_ENOANO = 55
  1428. const m_ENOBUFS = 105
  1429. const m_ENOCSI = 50
  1430. const m_ENODATA = 61
  1431. const m_ENODEV = 19
  1432. const m_ENOENT = 2
  1433. const m_ENOEXEC = 8
  1434. const m_ENOKEY = 126
  1435. const m_ENOLCK = 37
  1436. const m_ENOLINK = 67
  1437. const m_ENOMEDIUM = 123
  1438. const m_ENOMEM = 12
  1439. const m_ENOMSG = 42
  1440. const m_ENONET = 64
  1441. const m_ENOPKG = 65
  1442. const m_ENOPROTOOPT = 92
  1443. const m_ENOSPC = 28
  1444. const m_ENOSR = 63
  1445. const m_ENOSTR = 60
  1446. const m_ENOSYS = 38
  1447. const m_ENOTBLK = 15
  1448. const m_ENOTCONN = 107
  1449. const m_ENOTDIR = 20
  1450. const m_ENOTEMPTY = 39
  1451. const m_ENOTNAM = 118
  1452. const m_ENOTRECOVERABLE = 131
  1453. const m_ENOTSOCK = 88
  1454. const m_ENOTSUP = "EOPNOTSUPP"
  1455. const m_ENOTTY = 25
  1456. const m_ENOTUNIQ = 76
  1457. const m_ENXIO = 6
  1458. const m_EOPNOTSUPP = 95
  1459. const m_EOVERFLOW = 75
  1460. const m_EOWNERDEAD = 130
  1461. const m_EPERM = 1
  1462. const m_EPFNOSUPPORT = 96
  1463. const m_EPIPE = 32
  1464. const m_EPROTO = 71
  1465. const m_EPROTONOSUPPORT = 93
  1466. const m_EPROTOTYPE = 91
  1467. const m_ERANGE = 34
  1468. const m_EREMCHG = 78
  1469. const m_EREMOTE = 66
  1470. const m_EREMOTEIO = 121
  1471. const m_ERESTART = 85
  1472. const m_ERFKILL = 132
  1473. const m_EROFS = 30
  1474. const m_ESHUTDOWN = 108
  1475. const m_ESOCKTNOSUPPORT = 94
  1476. const m_ESPIPE = 29
  1477. const m_ESRCH = 3
  1478. const m_ESRMNT = 69
  1479. const m_ESTALE = 116
  1480. const m_ESTRPIPE = 86
  1481. const m_ETIME = 62
  1482. const m_ETIMEDOUT = 110
  1483. const m_ETOOMANYREFS = 109
  1484. const m_ETXTBSY = 26
  1485. const m_EUCLEAN = 117
  1486. const m_EUNATCH = 49
  1487. const m_EUSERS = 87
  1488. const m_EWOULDBLOCK = "EAGAIN"
  1489. const m_EXDEV = 18
  1490. const m_EXFULL = 54
  1491. const m_O_CREAT1 = 64
  1492. const m_O_EXCL1 = 128
  1493. const m_O_WRONLY1 = 1
  1494. const m_STATX_ALL = 0xfff
  1495. const m_STATX_ATIME = 0x20
  1496. const m_STATX_BASIC_STATS = 0x7ff
  1497. const m_STATX_BLOCKS = 0x400
  1498. const m_STATX_BTIME = 0x800
  1499. const m_STATX_CTIME = 0x80
  1500. const m_STATX_GID = 0x10
  1501. const m_STATX_INO = 0x100
  1502. const m_STATX_MODE = 2
  1503. const m_STATX_MTIME = 0x40
  1504. const m_STATX_NLINK = 4
  1505. const m_STATX_SIZE = 0x200
  1506. const m_STATX_TYPE = 1
  1507. const m_STATX_UID = 8
  1508. const m_S_IEXEC = "S_IXUSR"
  1509. const m_S_IFBLK = 0060000
  1510. const m_S_IFCHR = 0020000
  1511. const m_S_IFDIR = 0040000
  1512. const m_S_IFIFO = 0010000
  1513. const m_S_IFLNK = 0120000
  1514. const m_S_IFMT = 0170000
  1515. const m_S_IFREG = 0100000
  1516. const m_S_IFSOCK = 0140000
  1517. const m_S_IREAD = "S_IRUSR"
  1518. const m_S_IWRITE = "S_IWUSR"
  1519. const m_Time_t = "time_t"
  1520. const m_UTIME_NOW = 0x3fffffff
  1521. const m_UTIME_OMIT = 0x3ffffffe
  1522. type Tstat = struct {
  1523. Fst_dev Tdev_t
  1524. Fst_ino Tino_t
  1525. Fst_nlink Tnlink_t
  1526. Fst_mode Tmode_t
  1527. Fst_uid Tuid_t
  1528. Fst_gid Tgid_t
  1529. Fst_rdev Tdev_t
  1530. Fst_size Toff_t
  1531. Fst_blksize Tblksize_t
  1532. Fst_blocks Tblkcnt_t
  1533. Fst_atim Ttimespec
  1534. Fst_mtim Ttimespec
  1535. Fst_ctim Ttimespec
  1536. F__unused [3]uint64
  1537. }
  1538. type Tstatx_timestamp = struct {
  1539. Ftv_sec Tint64_t
  1540. Ftv_nsec Tuint32_t
  1541. F__pad Tuint32_t
  1542. }
  1543. type Tstatx = struct {
  1544. Fstx_mask Tuint32_t
  1545. Fstx_blksize Tuint32_t
  1546. Fstx_attributes Tuint64_t
  1547. Fstx_nlink Tuint32_t
  1548. Fstx_uid Tuint32_t
  1549. Fstx_gid Tuint32_t
  1550. Fstx_mode Tuint16_t
  1551. F__pad0 [1]Tuint16_t
  1552. Fstx_ino Tuint64_t
  1553. Fstx_size Tuint64_t
  1554. Fstx_blocks Tuint64_t
  1555. Fstx_attributes_mask Tuint64_t
  1556. Fstx_atime Tstatx_timestamp
  1557. Fstx_btime Tstatx_timestamp
  1558. Fstx_ctime Tstatx_timestamp
  1559. Fstx_mtime Tstatx_timestamp
  1560. Fstx_rdev_major Tuint32_t
  1561. Fstx_rdev_minor Tuint32_t
  1562. Fstx_dev_major Tuint32_t
  1563. Fstx_dev_minor Tuint32_t
  1564. F__pad1 [14]Tuint64_t
  1565. }
  1566. func XXauLockAuth(tls *libc.TLS, file_name uintptr, retries int32, timeout int32, dead int64) (r int32) {
  1567. bp := tls.Alloc(2224)
  1568. defer tls.Free(2224)
  1569. var creat_fd int32
  1570. var now Ttime_t
  1571. var _ /* creat_name at bp+0 */ [1025]uint8
  1572. var _ /* link_name at bp+1025 */ [1025]uint8
  1573. var _ /* statb at bp+2056 */ Tstat
  1574. _, _ = creat_fd, now
  1575. creat_fd = -int32(1)
  1576. if libc.Xstrlen(tls, file_name) > uint64(1022) {
  1577. return int32(m_LOCK_ERROR)
  1578. }
  1579. libc.X__builtin_snprintf(tls, bp, uint64(1025), __ccgo_ts+37, libc.VaList(bp+2208, file_name))
  1580. libc.X__builtin_snprintf(tls, bp+1025, uint64(1025), __ccgo_ts+42, libc.VaList(bp+2208, file_name))
  1581. if libc.Xstat(tls, bp, bp+2056) != -int32(1) {
  1582. now = libc.Xtime(tls, libc.UintptrFromInt32(0))
  1583. /*
  1584. * NFS may cause ctime to be before now, special
  1585. * case a 0 deadtime to force lock removal
  1586. */
  1587. if dead == 0 || now-(*(*Tstat)(unsafe.Pointer(bp + 2056))).Fst_ctim.Ftv_sec > dead {
  1588. libc.Xremove(tls, bp)
  1589. libc.Xremove(tls, bp+1025)
  1590. }
  1591. }
  1592. for retries > 0 {
  1593. if creat_fd == -int32(1) {
  1594. creat_fd = libc.Xopen(tls, bp, libc.Int32FromInt32(m_O_WRONLY1)|libc.Int32FromInt32(m_O_CREAT1)|libc.Int32FromInt32(m_O_EXCL1), libc.VaList(bp+2208, int32(0600)))
  1595. if creat_fd == -int32(1) {
  1596. if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) != int32(m_EACCES) && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) != int32(m_EEXIST) {
  1597. return int32(m_LOCK_ERROR)
  1598. }
  1599. } else {
  1600. libc.Xclose(tls, creat_fd)
  1601. }
  1602. }
  1603. if creat_fd != -int32(1) {
  1604. /* The file system may not support hard links, and pathconf should tell us that. */
  1605. if int64(1) == libc.Xpathconf(tls, bp, m__PC_LINK_MAX) {
  1606. if -int32(1) == libc.Xrename(tls, bp, bp+1025) {
  1607. /* Is this good enough? Perhaps we should retry. TEST */
  1608. return int32(m_LOCK_ERROR)
  1609. } else {
  1610. return m_LOCK_SUCCESS
  1611. }
  1612. } else {
  1613. if libc.Xlink(tls, bp, bp+1025) != -int32(1) {
  1614. return m_LOCK_SUCCESS
  1615. }
  1616. if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(m_ENOENT) {
  1617. creat_fd = -int32(1) /* force re-creat next time around */
  1618. continue
  1619. }
  1620. if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) != int32(m_EEXIST) {
  1621. return int32(m_LOCK_ERROR)
  1622. }
  1623. }
  1624. }
  1625. libc.Xsleep(tls, libc.Uint32FromInt32(timeout))
  1626. retries--
  1627. }
  1628. return int32(m_LOCK_TIMEOUT)
  1629. }
  1630. func _read_short(tls *libc.TLS, shortp uintptr, file uintptr) (r int32) {
  1631. bp := tls.Alloc(16)
  1632. defer tls.Free(16)
  1633. var _ /* file_short at bp+0 */ [2]uint8
  1634. if libc.Xfread(tls, bp, uint64(2), uint64(1), file) != uint64(1) {
  1635. return 0
  1636. }
  1637. *(*uint16)(unsafe.Pointer(shortp)) = libc.Uint16FromInt32(libc.Int32FromUint8((*(*[2]uint8)(unsafe.Pointer(bp)))[0])*int32(256) + libc.Int32FromUint8((*(*[2]uint8)(unsafe.Pointer(bp)))[int32(1)]))
  1638. return int32(1)
  1639. }
  1640. func _read_counted_string(tls *libc.TLS, countp uintptr, stringp uintptr, file uintptr) (r int32) {
  1641. bp := tls.Alloc(16)
  1642. defer tls.Free(16)
  1643. var data uintptr
  1644. var _ /* len at bp+0 */ uint16
  1645. _ = data
  1646. if _read_short(tls, bp, file) == 0 {
  1647. return 0
  1648. }
  1649. if libc.Int32FromUint16(*(*uint16)(unsafe.Pointer(bp))) == 0 {
  1650. data = libc.UintptrFromInt32(0)
  1651. } else {
  1652. data = libc.Xmalloc(tls, uint64(uint32(*(*uint16)(unsafe.Pointer(bp)))))
  1653. if !(data != 0) {
  1654. return 0
  1655. }
  1656. if libc.Xfread(tls, data, uint64(1), uint64(*(*uint16)(unsafe.Pointer(bp))), file) != uint64(*(*uint16)(unsafe.Pointer(bp))) {
  1657. libc.Xmemset(tls, data, 0, uint64(*(*uint16)(unsafe.Pointer(bp))))
  1658. libc.Xfree(tls, data)
  1659. return 0
  1660. }
  1661. }
  1662. *(*uintptr)(unsafe.Pointer(stringp)) = data
  1663. *(*uint16)(unsafe.Pointer(countp)) = *(*uint16)(unsafe.Pointer(bp))
  1664. return int32(1)
  1665. }
  1666. func XXauReadAuth(tls *libc.TLS, auth_file uintptr) (r uintptr) {
  1667. bp := tls.Alloc(64)
  1668. defer tls.Free(64)
  1669. var ret uintptr
  1670. var _ /* local at bp+0 */ TXauth
  1671. _ = ret
  1672. if _read_short(tls, bp, auth_file) == 0 {
  1673. return libc.UintptrFromInt32(0)
  1674. }
  1675. if _read_counted_string(tls, bp+2, bp+8, auth_file) == 0 {
  1676. return libc.UintptrFromInt32(0)
  1677. }
  1678. if _read_counted_string(tls, bp+16, bp+24, auth_file) == 0 {
  1679. libc.Xfree(tls, (*(*TXauth)(unsafe.Pointer(bp))).Faddress)
  1680. return libc.UintptrFromInt32(0)
  1681. }
  1682. if _read_counted_string(tls, bp+32, bp+40, auth_file) == 0 {
  1683. libc.Xfree(tls, (*(*TXauth)(unsafe.Pointer(bp))).Faddress)
  1684. libc.Xfree(tls, (*(*TXauth)(unsafe.Pointer(bp))).Fnumber)
  1685. return libc.UintptrFromInt32(0)
  1686. }
  1687. if _read_counted_string(tls, bp+48, bp+56, auth_file) == 0 {
  1688. libc.Xfree(tls, (*(*TXauth)(unsafe.Pointer(bp))).Faddress)
  1689. libc.Xfree(tls, (*(*TXauth)(unsafe.Pointer(bp))).Fnumber)
  1690. libc.Xfree(tls, (*(*TXauth)(unsafe.Pointer(bp))).Fname)
  1691. return libc.UintptrFromInt32(0)
  1692. }
  1693. ret = libc.Xmalloc(tls, uint64(64))
  1694. if !(ret != 0) {
  1695. libc.Xfree(tls, (*(*TXauth)(unsafe.Pointer(bp))).Faddress)
  1696. libc.Xfree(tls, (*(*TXauth)(unsafe.Pointer(bp))).Fnumber)
  1697. libc.Xfree(tls, (*(*TXauth)(unsafe.Pointer(bp))).Fname)
  1698. if (*(*TXauth)(unsafe.Pointer(bp))).Fdata != 0 {
  1699. libc.Xmemset(tls, (*(*TXauth)(unsafe.Pointer(bp))).Fdata, 0, uint64((*(*TXauth)(unsafe.Pointer(bp))).Fdata_length))
  1700. libc.Xfree(tls, (*(*TXauth)(unsafe.Pointer(bp))).Fdata)
  1701. }
  1702. return libc.UintptrFromInt32(0)
  1703. }
  1704. *(*TXauth)(unsafe.Pointer(ret)) = *(*TXauth)(unsafe.Pointer(bp))
  1705. return ret
  1706. }
  1707. const m_O_CREAT2 = 0100
  1708. const m_O_EXCL2 = 0200
  1709. const m_O_WRONLY2 = 01
  1710. /* define X_GETTIMEOFDAY macro, a portable gettimeofday() */
  1711. /* use POSIX name for signal */
  1712. /*
  1713. * Copyright 1997 Metro Link Incorporated
  1714. *
  1715. * All Rights Reserved
  1716. *
  1717. * Permission to use, copy, modify, distribute, and sell this software and its
  1718. * documentation for any purpose is hereby granted without fee, provided that
  1719. * the above copyright notice appear in all copies and that both that
  1720. * copyright notice and this permission notice appear in supporting
  1721. * documentation, and that the names of the above listed copyright holder(s)
  1722. * not be used in advertising or publicity pertaining to distribution of
  1723. * the software without specific, written prior permission. The above listed
  1724. * copyright holder(s) make(s) no representations about the suitability of
  1725. * this software for any purpose. It is provided "as is" without express or
  1726. * implied warranty.
  1727. *
  1728. * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD
  1729. * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  1730. * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
  1731. * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
  1732. * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
  1733. * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
  1734. * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  1735. */
  1736. /*
  1737. * Determine the machine's byte order.
  1738. */
  1739. /* See if it is set in the imake config first */
  1740. /* 'endian.h' might have been included before 'Xarch.h' */
  1741. func XXauUnlockAuth(tls *libc.TLS, file_name uintptr) (r int32) {
  1742. bp := tls.Alloc(2080)
  1743. defer tls.Free(2080)
  1744. var _ /* creat_name at bp+0 */ [1025]uint8
  1745. var _ /* link_name at bp+1025 */ [1025]uint8
  1746. if libc.Xstrlen(tls, file_name) > uint64(1022) {
  1747. return 0
  1748. }
  1749. libc.X__builtin_snprintf(tls, bp, uint64(1025), __ccgo_ts+37, libc.VaList(bp+2064, file_name))
  1750. libc.X__builtin_snprintf(tls, bp+1025, uint64(1025), __ccgo_ts+42, libc.VaList(bp+2064, file_name))
  1751. /*
  1752. * I think this is the correct order
  1753. */
  1754. libc.Xremove(tls, bp)
  1755. libc.Xremove(tls, bp+1025)
  1756. return int32(1)
  1757. }
  1758. /* Return values from XauLockAuth */
  1759. func _write_short(tls *libc.TLS, s uint16, file uintptr) (r int32) {
  1760. bp := tls.Alloc(16)
  1761. defer tls.Free(16)
  1762. var _ /* file_short at bp+0 */ [2]uint8
  1763. (*(*[2]uint8)(unsafe.Pointer(bp)))[0] = uint8(uint32(s) & libc.Uint32FromInt32(0xff00) >> int32(8))
  1764. (*(*[2]uint8)(unsafe.Pointer(bp)))[int32(1)] = libc.Uint8FromInt32(libc.Int32FromUint16(s) & int32(0xff))
  1765. if libc.Xfwrite(tls, bp, uint64(2), uint64(1), file) != uint64(1) {
  1766. return 0
  1767. }
  1768. return int32(1)
  1769. }
  1770. func _write_counted_string(tls *libc.TLS, count uint16, string1 uintptr, file uintptr) (r int32) {
  1771. if _write_short(tls, count, file) == 0 {
  1772. return 0
  1773. }
  1774. if libc.Xfwrite(tls, string1, uint64(1), uint64(count), file) != uint64(count) {
  1775. return 0
  1776. }
  1777. return int32(1)
  1778. }
  1779. func XXauWriteAuth(tls *libc.TLS, auth_file uintptr, auth uintptr) (r int32) {
  1780. if _write_short(tls, (*TXauth)(unsafe.Pointer(auth)).Ffamily, auth_file) == 0 {
  1781. return 0
  1782. }
  1783. if _write_counted_string(tls, (*TXauth)(unsafe.Pointer(auth)).Faddress_length, (*TXauth)(unsafe.Pointer(auth)).Faddress, auth_file) == 0 {
  1784. return 0
  1785. }
  1786. if _write_counted_string(tls, (*TXauth)(unsafe.Pointer(auth)).Fnumber_length, (*TXauth)(unsafe.Pointer(auth)).Fnumber, auth_file) == 0 {
  1787. return 0
  1788. }
  1789. if _write_counted_string(tls, (*TXauth)(unsafe.Pointer(auth)).Fname_length, (*TXauth)(unsafe.Pointer(auth)).Fname, auth_file) == 0 {
  1790. return 0
  1791. }
  1792. if _write_counted_string(tls, (*TXauth)(unsafe.Pointer(auth)).Fdata_length, (*TXauth)(unsafe.Pointer(auth)).Fdata, auth_file) == 0 {
  1793. return 0
  1794. }
  1795. return int32(1)
  1796. }
  1797. func __ccgo_fp(f interface{}) uintptr {
  1798. type iface [2]uintptr
  1799. return (*iface)(unsafe.Pointer(&f))[1]
  1800. }
  1801. var __ccgo_ts = (*reflect.StringHeader)(unsafe.Pointer(&__ccgo_ts1)).Data
  1802. var __ccgo_ts1 = "/.Xauthority\x00XAUTHORITY\x00HOME\x00%s%s\x00rb\x00%s-c\x00%s-l\x00"