ccgo_linux_arm.go 58 KB

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