ccgo_linux_s390x.go 53 KB

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