ccgo_linux_amd64.go 57 KB

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