ccgo_linux_loong64.go 59 KB

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