ccgo_linux_arm64.go 56 KB

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