ccgo_freebsd_amd64.go 71 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483
  1. // Code generated for freebsd/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 freebsd && 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 = 1024
  15. const m_FOPEN_MAX = 20
  16. const m_FUNCPROTO = 15
  17. const m_FamilyKrb5Principal = 253
  18. const m_FamilyLocal = 256
  19. const m_FamilyLocalHost = 252
  20. const m_FamilyNetname = 254
  21. const m_FamilyWild = 65535
  22. const m_HAVE_CONFIG_H = 1
  23. const m_HAVE_DLFCN_H = 1
  24. const m_HAVE_EXPLICIT_BZERO = 1
  25. const m_HAVE_INTTYPES_H = 1
  26. const m_HAVE_PATHCONF = 1
  27. const m_HAVE_STDINT_H = 1
  28. const m_HAVE_STDIO_H = 1
  29. const m_HAVE_STDLIB_H = 1
  30. const m_HAVE_STRINGS_H = 1
  31. const m_HAVE_STRING_H = 1
  32. const m_HAVE_SYS_STAT_H = 1
  33. const m_HAVE_SYS_TYPES_H = 1
  34. const m_HAVE_UNISTD_H = 1
  35. const m_HAVE_WCHAR_H = 1
  36. const m_LOCK_ERROR = 1
  37. const m_LOCK_SUCCESS = 0
  38. const m_LOCK_TIMEOUT = 2
  39. const m_LT_OBJDIR = ".libs/"
  40. const m_L_ctermid = 1024
  41. const m_L_cuserid = 17
  42. const m_L_tmpnam = 1024
  43. const m_NDEBUG = 1
  44. const m_NeedFunctionPrototypes = 1
  45. const m_NeedNestedPrototypes = 1
  46. const m_NeedVarargsPrototypes = 1
  47. const m_NeedWidePrototypes = 0
  48. const m_PACKAGE = "libXau"
  49. const m_PACKAGE_BUGREPORT = "https://gitlab.freedesktop.org/xorg/lib/libxau/-/issues"
  50. const m_PACKAGE_NAME = "libXau"
  51. const m_PACKAGE_STRING = "libXau 1.0.11"
  52. const m_PACKAGE_TARNAME = "libXau"
  53. const m_PACKAGE_URL = ""
  54. const m_PACKAGE_VERSION = "1.0.11"
  55. const m_PACKAGE_VERSION_MAJOR = 1
  56. const m_PACKAGE_VERSION_MINOR = 0
  57. const m_PACKAGE_VERSION_PATCHLEVEL = 11
  58. const m_P_tmpdir = "/tmp/"
  59. const m_RAND_MAX = 0x7fffffff
  60. const m_SEEK_CUR = 1
  61. const m_SEEK_END = 2
  62. const m_SEEK_SET = 0
  63. const m_STDC_HEADERS = 1
  64. const m_TMP_MAX = 308915776
  65. const m_VERSION = "1.0.11"
  66. const m_XTHREADS = 1
  67. const m_XUSE_MTSAFE_API = 1
  68. const m__ALL_SOURCE = 1
  69. const m__DARWIN_C_SOURCE = 1
  70. const m__GNU_SOURCE = 1
  71. const m__HPUX_ALT_XOPEN_SOCKET_API = 1
  72. const m__IOFBF = 0
  73. const m__IOLBF = 1
  74. const m__IONBF = 2
  75. const m__LP64 = 1
  76. const m__NETBSD_SOURCE = 1
  77. const m__OPENBSD_SOURCE = 1
  78. const m__POSIX_PTHREAD_SEMANTICS = 1
  79. const m__TANDEM_SOURCE = 1
  80. const m__X_INLINE = "inline"
  81. const m__X_RESTRICT_KYWD = "restrict"
  82. const m__Xconst = "const"
  83. const m___ATOMIC_ACQUIRE = 2
  84. const m___ATOMIC_ACQ_REL = 4
  85. const m___ATOMIC_CONSUME = 1
  86. const m___ATOMIC_RELAXED = 0
  87. const m___ATOMIC_RELEASE = 3
  88. const m___ATOMIC_SEQ_CST = 5
  89. const m___BIGGEST_ALIGNMENT__ = 16
  90. const m___BITINT_MAXWIDTH__ = 8388608
  91. const m___BOOL_WIDTH__ = 8
  92. const m___BSD_VISIBLE = 1
  93. const m___BYTE_ORDER__ = "__ORDER_LITTLE_ENDIAN__"
  94. const m___CCGO__ = 1
  95. const m___CC_SUPPORTS_DYNAMIC_ARRAY_INIT = 1
  96. const m___CC_SUPPORTS_INLINE = 1
  97. const m___CC_SUPPORTS_VARADIC_XXX = 1
  98. const m___CC_SUPPORTS_WARNING = 1
  99. const m___CC_SUPPORTS___FUNC__ = 1
  100. const m___CC_SUPPORTS___INLINE = 1
  101. const m___CC_SUPPORTS___INLINE__ = 1
  102. const m___CHAR_BIT = 8
  103. const m___CHAR_BIT__ = 8
  104. const m___CLANG_ATOMIC_BOOL_LOCK_FREE = 2
  105. const m___CLANG_ATOMIC_CHAR16_T_LOCK_FREE = 2
  106. const m___CLANG_ATOMIC_CHAR32_T_LOCK_FREE = 2
  107. const m___CLANG_ATOMIC_CHAR_LOCK_FREE = 2
  108. const m___CLANG_ATOMIC_INT_LOCK_FREE = 2
  109. const m___CLANG_ATOMIC_LLONG_LOCK_FREE = 2
  110. const m___CLANG_ATOMIC_LONG_LOCK_FREE = 2
  111. const m___CLANG_ATOMIC_POINTER_LOCK_FREE = 2
  112. const m___CLANG_ATOMIC_SHORT_LOCK_FREE = 2
  113. const m___CLANG_ATOMIC_WCHAR_T_LOCK_FREE = 2
  114. const m___CONSTANT_CFSTRINGS__ = 1
  115. const m___DBL_DECIMAL_DIG__ = 17
  116. const m___DBL_DENORM_MIN__ = 4.9406564584124654e-324
  117. const m___DBL_DIG__ = 15
  118. const m___DBL_EPSILON__ = 2.2204460492503131e-16
  119. const m___DBL_HAS_DENORM__ = 1
  120. const m___DBL_HAS_INFINITY__ = 1
  121. const m___DBL_HAS_QUIET_NAN__ = 1
  122. const m___DBL_MANT_DIG__ = 53
  123. const m___DBL_MAX_10_EXP__ = 308
  124. const m___DBL_MAX_EXP__ = 1024
  125. const m___DBL_MAX__ = 1.7976931348623157e+308
  126. const m___DBL_MIN__ = 2.2250738585072014e-308
  127. const m___DECIMAL_DIG__ = "__LDBL_DECIMAL_DIG__"
  128. const m___ELF__ = 1
  129. const m___EXT1_VISIBLE = 1
  130. const m___EXTENSIONS__ = 1
  131. const m___FINITE_MATH_ONLY__ = 0
  132. const m___FLOAT128__ = 1
  133. const m___FLT16_DECIMAL_DIG__ = 5
  134. const m___FLT16_DENORM_MIN__ = 5.9604644775390625e-8
  135. const m___FLT16_DIG__ = 3
  136. const m___FLT16_EPSILON__ = 9.765625e-4
  137. const m___FLT16_HAS_DENORM__ = 1
  138. const m___FLT16_HAS_INFINITY__ = 1
  139. const m___FLT16_HAS_QUIET_NAN__ = 1
  140. const m___FLT16_MANT_DIG__ = 11
  141. const m___FLT16_MAX_10_EXP__ = 4
  142. const m___FLT16_MAX_EXP__ = 16
  143. const m___FLT16_MAX__ = 6.5504e+4
  144. const m___FLT16_MIN__ = 6.103515625e-5
  145. const m___FLT_DECIMAL_DIG__ = 9
  146. const m___FLT_DENORM_MIN__ = 1.40129846e-45
  147. const m___FLT_DIG__ = 6
  148. const m___FLT_EPSILON__ = 1.19209290e-7
  149. const m___FLT_HAS_DENORM__ = 1
  150. const m___FLT_HAS_INFINITY__ = 1
  151. const m___FLT_HAS_QUIET_NAN__ = 1
  152. const m___FLT_MANT_DIG__ = 24
  153. const m___FLT_MAX_10_EXP__ = 38
  154. const m___FLT_MAX_EXP__ = 128
  155. const m___FLT_MAX__ = 3.40282347e+38
  156. const m___FLT_MIN__ = 1.17549435e-38
  157. const m___FLT_RADIX__ = 2
  158. const m___FPCLASS_NEGINF = 0x0004
  159. const m___FPCLASS_NEGNORMAL = 0x0008
  160. const m___FPCLASS_NEGSUBNORMAL = 0x0010
  161. const m___FPCLASS_NEGZERO = 0x0020
  162. const m___FPCLASS_POSINF = 0x0200
  163. const m___FPCLASS_POSNORMAL = 0x0100
  164. const m___FPCLASS_POSSUBNORMAL = 0x0080
  165. const m___FPCLASS_POSZERO = 0x0040
  166. const m___FPCLASS_QNAN = 0x0002
  167. const m___FPCLASS_SNAN = 0x0001
  168. const m___FUNCTION__ = "__func__"
  169. const m___FXSR__ = 1
  170. const m___FreeBSD__ = 14
  171. const m___FreeBSD_cc_version = 1400006
  172. const m___GCC_ASM_FLAG_OUTPUTS__ = 1
  173. const m___GCC_ATOMIC_BOOL_LOCK_FREE = 2
  174. const m___GCC_ATOMIC_CHAR16_T_LOCK_FREE = 2
  175. const m___GCC_ATOMIC_CHAR32_T_LOCK_FREE = 2
  176. const m___GCC_ATOMIC_CHAR_LOCK_FREE = 2
  177. const m___GCC_ATOMIC_INT_LOCK_FREE = 2
  178. const m___GCC_ATOMIC_LLONG_LOCK_FREE = 2
  179. const m___GCC_ATOMIC_LONG_LOCK_FREE = 2
  180. const m___GCC_ATOMIC_POINTER_LOCK_FREE = 2
  181. const m___GCC_ATOMIC_SHORT_LOCK_FREE = 2
  182. const m___GCC_ATOMIC_TEST_AND_SET_TRUEVAL = 1
  183. const m___GCC_ATOMIC_WCHAR_T_LOCK_FREE = 2
  184. const m___GCC_HAVE_DWARF2_CFI_ASM = 1
  185. const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 = 1
  186. const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 = 1
  187. const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 = 1
  188. const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 = 1
  189. const m___GNUCLIKE_ASM = 3
  190. const m___GNUCLIKE_BUILTIN_CONSTANT_P = 1
  191. const m___GNUCLIKE_BUILTIN_MEMCPY = 1
  192. const m___GNUCLIKE_BUILTIN_NEXT_ARG = 1
  193. const m___GNUCLIKE_BUILTIN_STDARG = 1
  194. const m___GNUCLIKE_BUILTIN_VAALIST = 1
  195. const m___GNUCLIKE_BUILTIN_VARARGS = 1
  196. const m___GNUCLIKE_CTOR_SECTION_HANDLING = 1
  197. const m___GNUCLIKE___SECTION = 1
  198. const m___GNUCLIKE___TYPEOF = 1
  199. const m___GNUC_MINOR__ = 2
  200. const m___GNUC_PATCHLEVEL__ = 1
  201. const m___GNUC_STDC_INLINE__ = 1
  202. const m___GNUC_VA_LIST_COMPATIBILITY = 1
  203. const m___GNUC__ = 4
  204. const m___GXX_ABI_VERSION = 1002
  205. const m___INT16_FMTd__ = "hd"
  206. const m___INT16_FMTi__ = "hi"
  207. const m___INT16_MAX__ = 32767
  208. const m___INT16_TYPE__ = "short"
  209. const m___INT32_FMTd__ = "d"
  210. const m___INT32_FMTi__ = "i"
  211. const m___INT32_MAX__ = 2147483647
  212. const m___INT32_TYPE__ = "int"
  213. const m___INT64_C_SUFFIX__ = "L"
  214. const m___INT64_FMTd__ = "ld"
  215. const m___INT64_FMTi__ = "li"
  216. const m___INT64_MAX__ = 9223372036854775807
  217. const m___INT8_FMTd__ = "hhd"
  218. const m___INT8_FMTi__ = "hhi"
  219. const m___INT8_MAX__ = 127
  220. const m___INTMAX_C_SUFFIX__ = "L"
  221. const m___INTMAX_FMTd__ = "ld"
  222. const m___INTMAX_FMTi__ = "li"
  223. const m___INTMAX_MAX__ = 9223372036854775807
  224. const m___INTMAX_WIDTH__ = 64
  225. const m___INTPTR_FMTd__ = "ld"
  226. const m___INTPTR_FMTi__ = "li"
  227. const m___INTPTR_MAX__ = 9223372036854775807
  228. const m___INTPTR_WIDTH__ = 64
  229. const m___INT_FAST16_FMTd__ = "hd"
  230. const m___INT_FAST16_FMTi__ = "hi"
  231. const m___INT_FAST16_MAX__ = 32767
  232. const m___INT_FAST16_TYPE__ = "short"
  233. const m___INT_FAST16_WIDTH__ = 16
  234. const m___INT_FAST32_FMTd__ = "d"
  235. const m___INT_FAST32_FMTi__ = "i"
  236. const m___INT_FAST32_MAX__ = 2147483647
  237. const m___INT_FAST32_TYPE__ = "int"
  238. const m___INT_FAST32_WIDTH__ = 32
  239. const m___INT_FAST64_FMTd__ = "ld"
  240. const m___INT_FAST64_FMTi__ = "li"
  241. const m___INT_FAST64_MAX__ = 9223372036854775807
  242. const m___INT_FAST64_WIDTH__ = 64
  243. const m___INT_FAST8_FMTd__ = "hhd"
  244. const m___INT_FAST8_FMTi__ = "hhi"
  245. const m___INT_FAST8_MAX__ = 127
  246. const m___INT_FAST8_WIDTH__ = 8
  247. const m___INT_LEAST16_FMTd__ = "hd"
  248. const m___INT_LEAST16_FMTi__ = "hi"
  249. const m___INT_LEAST16_MAX__ = 32767
  250. const m___INT_LEAST16_TYPE__ = "short"
  251. const m___INT_LEAST16_WIDTH__ = 16
  252. const m___INT_LEAST32_FMTd__ = "d"
  253. const m___INT_LEAST32_FMTi__ = "i"
  254. const m___INT_LEAST32_MAX__ = 2147483647
  255. const m___INT_LEAST32_TYPE__ = "int"
  256. const m___INT_LEAST32_WIDTH__ = 32
  257. const m___INT_LEAST64_FMTd__ = "ld"
  258. const m___INT_LEAST64_FMTi__ = "li"
  259. const m___INT_LEAST64_MAX__ = 9223372036854775807
  260. const m___INT_LEAST64_WIDTH__ = 64
  261. const m___INT_LEAST8_FMTd__ = "hhd"
  262. const m___INT_LEAST8_FMTi__ = "hhi"
  263. const m___INT_LEAST8_MAX__ = 127
  264. const m___INT_LEAST8_WIDTH__ = 8
  265. const m___INT_MAX = 0x7fffffff
  266. const m___INT_MAX__ = 2147483647
  267. const m___INT_WIDTH__ = 32
  268. const m___ISO_C_VISIBLE = 2011
  269. const m___KPRINTF_ATTRIBUTE__ = 1
  270. const m___LDBL_DECIMAL_DIG__ = 17
  271. const m___LDBL_DENORM_MIN__ = 4.9406564584124654e-324
  272. const m___LDBL_DIG__ = 15
  273. const m___LDBL_EPSILON__ = 2.2204460492503131e-16
  274. const m___LDBL_HAS_DENORM__ = 1
  275. const m___LDBL_HAS_INFINITY__ = 1
  276. const m___LDBL_HAS_QUIET_NAN__ = 1
  277. const m___LDBL_MANT_DIG__ = 53
  278. const m___LDBL_MAX_10_EXP__ = 308
  279. const m___LDBL_MAX_EXP__ = 1024
  280. const m___LDBL_MAX__ = 1.7976931348623157e+308
  281. const m___LDBL_MIN__ = 2.2250738585072014e-308
  282. const m___LITTLE_ENDIAN__ = 1
  283. const m___LLONG_MAX = 0x7fffffffffffffff
  284. const m___LLONG_WIDTH__ = 64
  285. const m___LONG_BIT = 64
  286. const m___LONG_LONG_MAX__ = 9223372036854775807
  287. const m___LONG_MAX = 0x7fffffffffffffff
  288. const m___LONG_MAX__ = 9223372036854775807
  289. const m___LONG_WIDTH__ = 64
  290. const m___LP64__ = 1
  291. const m___MEMORY_SCOPE_DEVICE = 1
  292. const m___MEMORY_SCOPE_SINGLE = 4
  293. const m___MEMORY_SCOPE_SYSTEM = 0
  294. const m___MEMORY_SCOPE_WRKGRP = 2
  295. const m___MEMORY_SCOPE_WVFRNT = 3
  296. const m___MMX__ = 1
  297. const m___NO_INLINE__ = 1
  298. const m___NO_MATH_ERRNO__ = 1
  299. const m___NO_MATH_INLINES = 1
  300. const m___OBJC_BOOL_IS_BOOL = 0
  301. const m___OFF_MAX = "__LONG_MAX"
  302. const m___OFF_MIN = "__LONG_MIN"
  303. const m___OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES = 3
  304. const m___OPENCL_MEMORY_SCOPE_DEVICE = 2
  305. const m___OPENCL_MEMORY_SCOPE_SUB_GROUP = 4
  306. const m___OPENCL_MEMORY_SCOPE_WORK_GROUP = 1
  307. const m___OPENCL_MEMORY_SCOPE_WORK_ITEM = 0
  308. const m___ORDER_BIG_ENDIAN__ = 4321
  309. const m___ORDER_LITTLE_ENDIAN__ = 1234
  310. const m___ORDER_PDP_ENDIAN__ = 3412
  311. const m___POINTER_WIDTH__ = 64
  312. const m___POSIX_VISIBLE = 200809
  313. const m___PRAGMA_REDEFINE_EXTNAME = 1
  314. const m___PRETTY_FUNCTION__ = "__func__"
  315. const m___PTRDIFF_FMTd__ = "ld"
  316. const m___PTRDIFF_FMTi__ = "li"
  317. const m___PTRDIFF_MAX__ = 9223372036854775807
  318. const m___PTRDIFF_WIDTH__ = 64
  319. const m___QUAD_MAX = "__LONG_MAX"
  320. const m___QUAD_MIN = "__LONG_MIN"
  321. const m___S2OAP = 0x0001
  322. const m___SALC = 0x4000
  323. const m___SAPP = 0x0100
  324. const m___SCHAR_MAX = 0x7f
  325. const m___SCHAR_MAX__ = 127
  326. const m___SEG_FS = 1
  327. const m___SEG_GS = 1
  328. const m___SEOF = 0x0020
  329. const m___SERR = 0x0040
  330. const m___SHRT_MAX = 0x7fff
  331. const m___SHRT_MAX__ = 32767
  332. const m___SHRT_WIDTH__ = 16
  333. const m___SIGN = 0x8000
  334. const m___SIG_ATOMIC_MAX__ = 2147483647
  335. const m___SIG_ATOMIC_WIDTH__ = 32
  336. const m___SIZEOF_DOUBLE__ = 8
  337. const m___SIZEOF_FLOAT128__ = 16
  338. const m___SIZEOF_FLOAT__ = 4
  339. const m___SIZEOF_INT128__ = 16
  340. const m___SIZEOF_INT__ = 4
  341. const m___SIZEOF_LONG_DOUBLE__ = 8
  342. const m___SIZEOF_LONG_LONG__ = 8
  343. const m___SIZEOF_LONG__ = 8
  344. const m___SIZEOF_POINTER__ = 8
  345. const m___SIZEOF_PTRDIFF_T__ = 8
  346. const m___SIZEOF_SHORT__ = 2
  347. const m___SIZEOF_SIZE_T__ = 8
  348. const m___SIZEOF_WCHAR_T__ = 4
  349. const m___SIZEOF_WINT_T__ = 4
  350. const m___SIZE_FMTX__ = "lX"
  351. const m___SIZE_FMTo__ = "lo"
  352. const m___SIZE_FMTu__ = "lu"
  353. const m___SIZE_FMTx__ = "lx"
  354. const m___SIZE_MAX__ = 18446744073709551615
  355. const m___SIZE_T_MAX = "__ULONG_MAX"
  356. const m___SIZE_WIDTH__ = 64
  357. const m___SLBF = 0x0001
  358. const m___SMBF = 0x0080
  359. const m___SMOD = 0x2000
  360. const m___SNBF = 0x0002
  361. const m___SNPT = 0x0800
  362. const m___SOFF = 0x1000
  363. const m___SOPT = 0x0400
  364. const m___SRD = 0x0004
  365. const m___SRW = 0x0010
  366. const m___SSE2_MATH__ = 1
  367. const m___SSE2__ = 1
  368. const m___SSE_MATH__ = 1
  369. const m___SSE__ = 1
  370. const m___SSIZE_MAX = "__LONG_MAX"
  371. const m___SSTR = 0x0200
  372. const m___STDC_HOSTED__ = 1
  373. const m___STDC_MB_MIGHT_NEQ_WC__ = 1
  374. const m___STDC_UTF_16__ = 1
  375. const m___STDC_UTF_32__ = 1
  376. const m___STDC_VERSION__ = 201710
  377. const m___STDC_WANT_IEC_60559_ATTRIBS_EXT__ = 1
  378. const m___STDC_WANT_IEC_60559_BFP_EXT__ = 1
  379. const m___STDC_WANT_IEC_60559_DFP_EXT__ = 1
  380. const m___STDC_WANT_IEC_60559_FUNCS_EXT__ = 1
  381. const m___STDC_WANT_IEC_60559_TYPES_EXT__ = 1
  382. const m___STDC_WANT_LIB_EXT2__ = 1
  383. const m___STDC_WANT_MATH_SPEC_FUNCS__ = 1
  384. const m___STDC__ = 1
  385. const m___SWR = 0x0008
  386. const m___UCHAR_MAX = 0xff
  387. const m___UINT16_FMTX__ = "hX"
  388. const m___UINT16_FMTo__ = "ho"
  389. const m___UINT16_FMTu__ = "hu"
  390. const m___UINT16_FMTx__ = "hx"
  391. const m___UINT16_MAX__ = 65535
  392. const m___UINT32_C_SUFFIX__ = "U"
  393. const m___UINT32_FMTX__ = "X"
  394. const m___UINT32_FMTo__ = "o"
  395. const m___UINT32_FMTu__ = "u"
  396. const m___UINT32_FMTx__ = "x"
  397. const m___UINT32_MAX__ = 4294967295
  398. const m___UINT64_C_SUFFIX__ = "UL"
  399. const m___UINT64_FMTX__ = "lX"
  400. const m___UINT64_FMTo__ = "lo"
  401. const m___UINT64_FMTu__ = "lu"
  402. const m___UINT64_FMTx__ = "lx"
  403. const m___UINT64_MAX__ = 18446744073709551615
  404. const m___UINT8_FMTX__ = "hhX"
  405. const m___UINT8_FMTo__ = "hho"
  406. const m___UINT8_FMTu__ = "hhu"
  407. const m___UINT8_FMTx__ = "hhx"
  408. const m___UINT8_MAX__ = 255
  409. const m___UINTMAX_C_SUFFIX__ = "UL"
  410. const m___UINTMAX_FMTX__ = "lX"
  411. const m___UINTMAX_FMTo__ = "lo"
  412. const m___UINTMAX_FMTu__ = "lu"
  413. const m___UINTMAX_FMTx__ = "lx"
  414. const m___UINTMAX_MAX__ = 18446744073709551615
  415. const m___UINTMAX_WIDTH__ = 64
  416. const m___UINTPTR_FMTX__ = "lX"
  417. const m___UINTPTR_FMTo__ = "lo"
  418. const m___UINTPTR_FMTu__ = "lu"
  419. const m___UINTPTR_FMTx__ = "lx"
  420. const m___UINTPTR_MAX__ = 18446744073709551615
  421. const m___UINTPTR_WIDTH__ = 64
  422. const m___UINT_FAST16_FMTX__ = "hX"
  423. const m___UINT_FAST16_FMTo__ = "ho"
  424. const m___UINT_FAST16_FMTu__ = "hu"
  425. const m___UINT_FAST16_FMTx__ = "hx"
  426. const m___UINT_FAST16_MAX__ = 65535
  427. const m___UINT_FAST32_FMTX__ = "X"
  428. const m___UINT_FAST32_FMTo__ = "o"
  429. const m___UINT_FAST32_FMTu__ = "u"
  430. const m___UINT_FAST32_FMTx__ = "x"
  431. const m___UINT_FAST32_MAX__ = 4294967295
  432. const m___UINT_FAST64_FMTX__ = "lX"
  433. const m___UINT_FAST64_FMTo__ = "lo"
  434. const m___UINT_FAST64_FMTu__ = "lu"
  435. const m___UINT_FAST64_FMTx__ = "lx"
  436. const m___UINT_FAST64_MAX__ = 18446744073709551615
  437. const m___UINT_FAST8_FMTX__ = "hhX"
  438. const m___UINT_FAST8_FMTo__ = "hho"
  439. const m___UINT_FAST8_FMTu__ = "hhu"
  440. const m___UINT_FAST8_FMTx__ = "hhx"
  441. const m___UINT_FAST8_MAX__ = 255
  442. const m___UINT_LEAST16_FMTX__ = "hX"
  443. const m___UINT_LEAST16_FMTo__ = "ho"
  444. const m___UINT_LEAST16_FMTu__ = "hu"
  445. const m___UINT_LEAST16_FMTx__ = "hx"
  446. const m___UINT_LEAST16_MAX__ = 65535
  447. const m___UINT_LEAST32_FMTX__ = "X"
  448. const m___UINT_LEAST32_FMTo__ = "o"
  449. const m___UINT_LEAST32_FMTu__ = "u"
  450. const m___UINT_LEAST32_FMTx__ = "x"
  451. const m___UINT_LEAST32_MAX__ = 4294967295
  452. const m___UINT_LEAST64_FMTX__ = "lX"
  453. const m___UINT_LEAST64_FMTo__ = "lo"
  454. const m___UINT_LEAST64_FMTu__ = "lu"
  455. const m___UINT_LEAST64_FMTx__ = "lx"
  456. const m___UINT_LEAST64_MAX__ = 18446744073709551615
  457. const m___UINT_LEAST8_FMTX__ = "hhX"
  458. const m___UINT_LEAST8_FMTo__ = "hho"
  459. const m___UINT_LEAST8_FMTu__ = "hhu"
  460. const m___UINT_LEAST8_FMTx__ = "hhx"
  461. const m___UINT_LEAST8_MAX__ = 255
  462. const m___UINT_MAX = 0xffffffff
  463. const m___ULLONG_MAX = "0xffffffffffffffffU"
  464. const m___ULONG_MAX = 0xffffffffffffffff
  465. const m___UQUAD_MAX = "__ULONG_MAX"
  466. const m___USHRT_MAX = 0xffff
  467. const m___VERSION__ = "FreeBSD Clang 18.1.6 (https://github.com/llvm/llvm-project.git llvmorg-18.1.6-0-g1118c2e05e67)"
  468. const m___WCHAR_MAX = "__INT_MAX"
  469. const m___WCHAR_MAX__ = 2147483647
  470. const m___WCHAR_MIN = "__INT_MIN"
  471. const m___WCHAR_TYPE__ = "int"
  472. const m___WCHAR_WIDTH__ = 32
  473. const m___WINT_MAX__ = 2147483647
  474. const m___WINT_TYPE__ = "int"
  475. const m___WINT_WIDTH__ = 32
  476. const m___WORD_BIT = 32
  477. const m___XSI_VISIBLE = 700
  478. const m___amd64 = 1
  479. const m___amd64__ = 1
  480. const m___clang__ = 1
  481. const m___clang_literal_encoding__ = "UTF-8"
  482. const m___clang_major__ = 18
  483. const m___clang_minor__ = 1
  484. const m___clang_patchlevel__ = 6
  485. const m___clang_version__ = "18.1.6 (https://github.com/llvm/llvm-project.git llvmorg-18.1.6-0-g1118c2e05e67)"
  486. const m___clang_wide_literal_encoding__ = "UTF-32"
  487. const m___code_model_small__ = 1
  488. const m___const = "const"
  489. const m___k8 = 1
  490. const m___k8__ = 1
  491. const m___llvm__ = 1
  492. const m___restrict = "restrict"
  493. const m___restrict_arr = "restrict"
  494. const m___signed = "signed"
  495. const m___tune_k8__ = 1
  496. const m___unix = 1
  497. const m___unix__ = 1
  498. const m___volatile = "volatile"
  499. const m___writeonly = "__unused"
  500. const m___x86_64 = 1
  501. const m___x86_64__ = 1
  502. const m_stderr = "__stderrp"
  503. const m_stdin = "__stdinp"
  504. const m_stdout = "__stdoutp"
  505. const m_unix = 1
  506. type t__builtin_va_list = uintptr
  507. type t__predefined_size_t = uint64
  508. type t__predefined_wchar_t = int32
  509. type t__predefined_ptrdiff_t = int64
  510. type TXauth = struct {
  511. Ffamily uint16
  512. Faddress_length uint16
  513. Faddress uintptr
  514. Fnumber_length uint16
  515. Fnumber uintptr
  516. Fname_length uint16
  517. Fname uintptr
  518. Fdata_length uint16
  519. Fdata uintptr
  520. }
  521. type Txauth = TXauth
  522. type t__int8_t = int8
  523. type t__uint8_t = uint8
  524. type t__int16_t = int16
  525. type t__uint16_t = uint16
  526. type t__int32_t = int32
  527. type t__uint32_t = uint32
  528. type t__int64_t = int64
  529. type t__uint64_t = uint64
  530. type t__int_least8_t = int8
  531. type t__int_least16_t = int16
  532. type t__int_least32_t = int32
  533. type t__int_least64_t = int64
  534. type t__intmax_t = int64
  535. type t__uint_least8_t = uint8
  536. type t__uint_least16_t = uint16
  537. type t__uint_least32_t = uint32
  538. type t__uint_least64_t = uint64
  539. type t__uintmax_t = uint64
  540. type t__intptr_t = int64
  541. type t__intfptr_t = int64
  542. type t__uintptr_t = uint64
  543. type t__uintfptr_t = uint64
  544. type t__vm_offset_t = uint64
  545. type t__vm_size_t = uint64
  546. type t__size_t = uint64
  547. type t__ssize_t = int64
  548. type t__ptrdiff_t = int64
  549. type t__clock_t = int32
  550. type t__critical_t = int64
  551. type t__double_t = float64
  552. type t__float_t = float32
  553. type t__int_fast8_t = int32
  554. type t__int_fast16_t = int32
  555. type t__int_fast32_t = int32
  556. type t__int_fast64_t = int64
  557. type t__register_t = int64
  558. type t__segsz_t = int64
  559. type t__time_t = int64
  560. type t__uint_fast8_t = uint32
  561. type t__uint_fast16_t = uint32
  562. type t__uint_fast32_t = uint32
  563. type t__uint_fast64_t = uint64
  564. type t__u_register_t = uint64
  565. type t__vm_paddr_t = uint64
  566. type T___wchar_t = int32
  567. type t__blksize_t = int32
  568. type t__blkcnt_t = int64
  569. type t__clockid_t = int32
  570. type t__fflags_t = uint32
  571. type t__fsblkcnt_t = uint64
  572. type t__fsfilcnt_t = uint64
  573. type t__gid_t = uint32
  574. type t__id_t = int64
  575. type t__ino_t = uint64
  576. type t__key_t = int64
  577. type t__lwpid_t = int32
  578. type t__mode_t = uint16
  579. type t__accmode_t = int32
  580. type t__nl_item = int32
  581. type t__nlink_t = uint64
  582. type t__off_t = int64
  583. type t__off64_t = int64
  584. type t__pid_t = int32
  585. type t__sbintime_t = int64
  586. type t__rlim_t = int64
  587. type t__sa_family_t = uint8
  588. type t__socklen_t = uint32
  589. type t__suseconds_t = int64
  590. type t__timer_t = uintptr
  591. type t__mqd_t = uintptr
  592. type t__uid_t = uint32
  593. type t__useconds_t = uint32
  594. type t__cpuwhich_t = int32
  595. type t__cpulevel_t = int32
  596. type t__cpusetid_t = int32
  597. type t__daddr_t = int64
  598. type t__ct_rune_t = int32
  599. type t__rune_t = int32
  600. type t__wint_t = int32
  601. type t__char16_t = uint16
  602. type t__char32_t = uint32
  603. type t__max_align_t = struct {
  604. F__max_align1 int64
  605. F__max_align2 float64
  606. }
  607. type t__dev_t = uint64
  608. type t__fixpt_t = uint32
  609. type t__mbstate_t = struct {
  610. F_mbstateL [0]t__int64_t
  611. F__mbstate8 [128]int8
  612. }
  613. type t__rman_res_t = uint64
  614. type t__va_list = uintptr
  615. type t__gnuc_va_list = uintptr
  616. type Tsize_t = uint64
  617. type Tlocale_t = uintptr
  618. type Tmode_t = uint16
  619. type Tssize_t = int64
  620. type Trsize_t = uint64
  621. type Terrno_t = int32
  622. type Tfpos_t = int64
  623. type Toff_t = int64
  624. type Toff64_t = int64
  625. type Tva_list = uintptr
  626. type t__sbuf = struct {
  627. F_base uintptr
  628. F_size int32
  629. }
  630. type t__sFILE = struct {
  631. F_p uintptr
  632. F_r int32
  633. F_w int32
  634. F_flags int16
  635. F_file int16
  636. F_bf t__sbuf
  637. F_lbfsize int32
  638. F_cookie uintptr
  639. F_close uintptr
  640. F_read uintptr
  641. F_seek uintptr
  642. F_write uintptr
  643. F_ub t__sbuf
  644. F_up uintptr
  645. F_ur int32
  646. F_ubuf [3]uint8
  647. F_nbuf [1]uint8
  648. F_lb t__sbuf
  649. F_blksize int32
  650. F_offset Tfpos_t
  651. F_fl_mutex uintptr
  652. F_fl_owner uintptr
  653. F_fl_count int32
  654. F_orientation int32
  655. F_mbstate t__mbstate_t
  656. F_flags2 int32
  657. }
  658. type TFILE = struct {
  659. F_p uintptr
  660. F_r int32
  661. F_w int32
  662. F_flags int16
  663. F_file int16
  664. F_bf t__sbuf
  665. F_lbfsize int32
  666. F_cookie uintptr
  667. F_close uintptr
  668. F_read uintptr
  669. F_seek uintptr
  670. F_write uintptr
  671. F_ub t__sbuf
  672. F_up uintptr
  673. F_ur int32
  674. F_ubuf [3]uint8
  675. F_nbuf [1]uint8
  676. F_lb t__sbuf
  677. F_blksize int32
  678. F_offset Tfpos_t
  679. F_fl_mutex uintptr
  680. F_fl_owner uintptr
  681. F_fl_count int32
  682. F_orientation int32
  683. F_mbstate t__mbstate_t
  684. F_flags2 int32
  685. }
  686. type Tcookie_io_functions_t = struct {
  687. Fread uintptr
  688. Fwrite uintptr
  689. Fseek uintptr
  690. Fclose1 uintptr
  691. }
  692. type Trune_t = int32
  693. type Twchar_t = int32
  694. type Tdiv_t = struct {
  695. Fquot int32
  696. Frem int32
  697. }
  698. type Tldiv_t = struct {
  699. Fquot int64
  700. Frem int64
  701. }
  702. type Tlldiv_t = struct {
  703. Fquot int64
  704. Frem int64
  705. }
  706. type Tconstraint_handler_t = uintptr
  707. func XXauDisposeAuth(tls *libc.TLS, auth uintptr) {
  708. if auth != 0 {
  709. libc.Xfree(tls, (*TXauth)(unsafe.Pointer(auth)).Faddress)
  710. libc.Xfree(tls, (*TXauth)(unsafe.Pointer(auth)).Fnumber)
  711. libc.Xfree(tls, (*TXauth)(unsafe.Pointer(auth)).Fname)
  712. if (*TXauth)(unsafe.Pointer(auth)).Fdata != 0 {
  713. libc.Xexplicit_bzero(tls, (*TXauth)(unsafe.Pointer(auth)).Fdata, uint64((*TXauth)(unsafe.Pointer(auth)).Fdata_length))
  714. libc.Xfree(tls, (*TXauth)(unsafe.Pointer(auth)).Fdata)
  715. }
  716. libc.Xfree(tls, auth)
  717. }
  718. return
  719. }
  720. const m_AT_EACCESS = 0x0100
  721. const m_AT_EMPTY_PATH = 0x4000
  722. const m_AT_REMOVEDIR = 0x0800
  723. const m_AT_RESOLVE_BENEATH = 0x2000
  724. const m_AT_SYMLINK_FOLLOW = 0x0400
  725. const m_AT_SYMLINK_NOFOLLOW = 0x0200
  726. const m_BIG_ENDIAN = "_BIG_ENDIAN"
  727. const m_BYTE_ORDER = "_BYTE_ORDER"
  728. const m_CLK_TCK = 128
  729. const m_CLOCKS_PER_SEC = 128
  730. const m_CLOCK_BOOTTIME = "CLOCK_UPTIME"
  731. const m_CLOCK_MONOTONIC = 4
  732. const m_CLOCK_MONOTONIC_COARSE = "CLOCK_MONOTONIC_FAST"
  733. const m_CLOCK_MONOTONIC_FAST = 12
  734. const m_CLOCK_MONOTONIC_PRECISE = 11
  735. const m_CLOCK_PROCESS_CPUTIME_ID = 15
  736. const m_CLOCK_PROF = 2
  737. const m_CLOCK_REALTIME = 0
  738. const m_CLOCK_REALTIME_COARSE = "CLOCK_REALTIME_FAST"
  739. const m_CLOCK_REALTIME_FAST = 10
  740. const m_CLOCK_REALTIME_PRECISE = 9
  741. const m_CLOCK_SECOND = 13
  742. const m_CLOCK_THREAD_CPUTIME_ID = 14
  743. const m_CLOCK_UPTIME = 5
  744. const m_CLOCK_UPTIME_FAST = 8
  745. const m_CLOCK_UPTIME_PRECISE = 7
  746. const m_CLOCK_VIRTUAL = 1
  747. const m_CPUCLOCK_WHICH_PID = 0
  748. const m_CPUCLOCK_WHICH_TID = 1
  749. const m_DST_AUST = 2
  750. const m_DST_CAN = 6
  751. const m_DST_EET = 5
  752. const m_DST_MET = 4
  753. const m_DST_NONE = 0
  754. const m_DST_USA = 1
  755. const m_DST_WET = 3
  756. const m_FAPPEND = "O_APPEND"
  757. const m_FASYNC = "O_ASYNC"
  758. const m_FDSYNC = "O_DSYNC"
  759. const m_FD_CLOEXEC = 1
  760. const m_FD_SETSIZE = 1024
  761. const m_FFSYNC = "O_FSYNC"
  762. const m_FNDELAY = "O_NONBLOCK"
  763. const m_FNONBLOCK = "O_NONBLOCK"
  764. const m_FRDAHEAD = "O_CREAT"
  765. const m_FREAD = 0x0001
  766. const m_FWRITE = 0x0002
  767. const m_F_ADD_SEALS = 19
  768. const m_F_CANCEL = 5
  769. const m_F_DUP2FD = 10
  770. const m_F_DUP2FD_CLOEXEC = 18
  771. const m_F_DUPFD = 0
  772. const m_F_DUPFD_CLOEXEC = 17
  773. const m_F_GETFD = 1
  774. const m_F_GETFL = 3
  775. const m_F_GETLK = 11
  776. const m_F_GETOWN = 5
  777. const m_F_GET_SEALS = 20
  778. const m_F_ISUNIONSTACK = 21
  779. const m_F_KINFO = 22
  780. const m_F_LOCK = 1
  781. const m_F_OGETLK = 7
  782. const m_F_OK = 0
  783. const m_F_OSETLK = 8
  784. const m_F_OSETLKW = 9
  785. const m_F_RDAHEAD = 16
  786. const m_F_RDLCK = 1
  787. const m_F_READAHEAD = 15
  788. const m_F_SEAL_GROW = 0x0004
  789. const m_F_SEAL_SEAL = 0x0001
  790. const m_F_SEAL_SHRINK = 0x0002
  791. const m_F_SEAL_WRITE = 0x0008
  792. const m_F_SETFD = 2
  793. const m_F_SETFL = 4
  794. const m_F_SETLK = 12
  795. const m_F_SETLKW = 13
  796. const m_F_SETLK_REMOTE = 14
  797. const m_F_SETOWN = 6
  798. const m_F_TEST = 3
  799. const m_F_TLOCK = 2
  800. const m_F_ULOCK = 0
  801. const m_F_UNLCK = 2
  802. const m_F_UNLCKSYS = 4
  803. const m_F_WRLCK = 3
  804. const m_ITIMER_PROF = 2
  805. const m_ITIMER_REAL = 0
  806. const m_ITIMER_VIRTUAL = 1
  807. const m_KCMP_FILE = 100
  808. const m_KCMP_FILEOBJ = 101
  809. const m_KCMP_FILES = 102
  810. const m_KCMP_SIGHAND = 103
  811. const m_KCMP_VM = 104
  812. const m_LITTLE_ENDIAN = "_LITTLE_ENDIAN"
  813. const m_LOCK_EX = 0x02
  814. const m_LOCK_NB = 0x04
  815. const m_LOCK_SH = 0x01
  816. const m_LOCK_UN = 0x08
  817. const m_L_INCR = "SEEK_CUR"
  818. const m_L_SET = "SEEK_SET"
  819. const m_L_XTND = "SEEK_END"
  820. const m_NFDBITS = "_NFDBITS"
  821. const m_O_ACCMODE = 0x0003
  822. const m_O_APPEND = 0x0008
  823. const m_O_ASYNC = 0x0040
  824. const m_O_CLOEXEC = 0x00100000
  825. const m_O_CREAT = 0x0200
  826. const m_O_DIRECT = 0x00010000
  827. const m_O_DIRECTORY = 0x00020000
  828. const m_O_DSYNC = 0x01000000
  829. const m_O_EMPTY_PATH = 0x02000000
  830. const m_O_EXCL = 0x0800
  831. const m_O_EXEC = 0x00040000
  832. const m_O_EXLOCK = 0x0020
  833. const m_O_FSYNC = 0x0080
  834. const m_O_NDELAY = "O_NONBLOCK"
  835. const m_O_NOCTTY = 0x8000
  836. const m_O_NOFOLLOW = 0x0100
  837. const m_O_NONBLOCK = 0x0004
  838. const m_O_PATH = 0x00400000
  839. const m_O_RDONLY = 0x0000
  840. const m_O_RDWR = 0x0002
  841. const m_O_RESOLVE_BENEATH = 0x00800000
  842. const m_O_SEARCH = "O_EXEC"
  843. const m_O_SHLOCK = 0x0010
  844. const m_O_SYNC = 0x0080
  845. const m_O_TRUNC = 0x0400
  846. const m_O_TTY_INIT = 0x00080000
  847. const m_O_VERIFY = 0x00200000
  848. const m_O_WRONLY = 0x0001
  849. const m_PDP_ENDIAN = "_PDP_ENDIAN"
  850. const m_POSIX_FADV_DONTNEED = 4
  851. const m_POSIX_FADV_NOREUSE = 5
  852. const m_POSIX_FADV_NORMAL = 0
  853. const m_POSIX_FADV_RANDOM = 1
  854. const m_POSIX_FADV_SEQUENTIAL = 2
  855. const m_POSIX_FADV_WILLNEED = 3
  856. const m_RFTSIGMASK = 0xFF
  857. const m_RFTSIGSHIFT = 20
  858. const m_R_OK = 0x04
  859. const m_SBT_MAX = 0x7fffffffffffffff
  860. const m_SEEK_DATA = 3
  861. const m_SEEK_HOLE = 4
  862. const m_SPACECTL_DEALLOC = 1
  863. const m_SPACECTL_F_SUPPORTED = 0
  864. const m_STDERR_FILENO = 2
  865. const m_STDIN_FILENO = 0
  866. const m_STDOUT_FILENO = 1
  867. const m_SWAPOFF_FORCE = 0x00000001
  868. const m_TIMER_ABSTIME = 0x1
  869. const m_TIMER_RELTIME = 0x0
  870. const m_TIME_MONOTONIC = 2
  871. const m_TIME_UTC = 1
  872. const m_W_OK = 0x02
  873. const m_X_BIG_ENDIAN = "BIG_ENDIAN"
  874. const m_X_BYTE_ORDER = "BYTE_ORDER"
  875. const m_X_LITTLE_ENDIAN = "LITTLE_ENDIAN"
  876. const m_X_OK = 0x01
  877. const m__BYTE_ORDER = "__BYTE_ORDER__"
  878. const m__CS_PATH = 1
  879. const m__CS_POSIX_V6_ILP32_OFF32_CFLAGS = 2
  880. const m__CS_POSIX_V6_ILP32_OFF32_LDFLAGS = 3
  881. const m__CS_POSIX_V6_ILP32_OFF32_LIBS = 4
  882. const m__CS_POSIX_V6_ILP32_OFFBIG_CFLAGS = 5
  883. const m__CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS = 6
  884. const m__CS_POSIX_V6_ILP32_OFFBIG_LIBS = 7
  885. const m__CS_POSIX_V6_LP64_OFF64_CFLAGS = 8
  886. const m__CS_POSIX_V6_LP64_OFF64_LDFLAGS = 9
  887. const m__CS_POSIX_V6_LP64_OFF64_LIBS = 10
  888. const m__CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS = 11
  889. const m__CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS = 12
  890. const m__CS_POSIX_V6_LPBIG_OFFBIG_LIBS = 13
  891. const m__CS_POSIX_V6_WIDTH_RESTRICTED_ENVS = 14
  892. const m__PC_ACL_EXTENDED = 59
  893. const m__PC_ACL_NFS4 = 64
  894. const m__PC_ACL_PATH_MAX = 60
  895. const m__PC_ALLOC_SIZE_MIN = 10
  896. const m__PC_ASYNC_IO = 53
  897. const m__PC_CAP_PRESENT = 61
  898. const m__PC_CHOWN_RESTRICTED = 7
  899. const m__PC_DEALLOC_PRESENT = 65
  900. const m__PC_FILESIZEBITS = 12
  901. const m__PC_INF_PRESENT = 62
  902. const m__PC_LINK_MAX = 1
  903. const m__PC_MAC_PRESENT = 63
  904. const m__PC_MAX_CANON = 2
  905. const m__PC_MAX_INPUT = 3
  906. const m__PC_MIN_HOLE_SIZE = 21
  907. const m__PC_NAME_MAX = 4
  908. const m__PC_NO_TRUNC = 8
  909. const m__PC_PATH_MAX = 5
  910. const m__PC_PIPE_BUF = 6
  911. const m__PC_PRIO_IO = 54
  912. const m__PC_REC_INCR_XFER_SIZE = 14
  913. const m__PC_REC_MAX_XFER_SIZE = 15
  914. const m__PC_REC_MIN_XFER_SIZE = 16
  915. const m__PC_REC_XFER_ALIGN = 17
  916. const m__PC_SYMLINK_MAX = 18
  917. const m__PC_SYNC_IO = 55
  918. const m__PC_VDISABLE = 9
  919. const m__PDP_ENDIAN = "__ORDER_PDP_ENDIAN__"
  920. const m__POSIX2_CHAR_TERM = 1
  921. const m__POSIX2_C_BIND = 200112
  922. const m__POSIX2_FORT_RUN = 200112
  923. const m__POSIX2_UPE = 200112
  924. const m__POSIX2_VERSION = 199212
  925. const m__POSIX_ADVISORY_INFO = 200112
  926. const m__POSIX_ASYNCHRONOUS_IO = 200112
  927. const m__POSIX_BARRIERS = 200112
  928. const m__POSIX_CHOWN_RESTRICTED = 1
  929. const m__POSIX_CPUTIME = 200112
  930. const m__POSIX_FSYNC = 200112
  931. const m__POSIX_IPV6 = 0
  932. const m__POSIX_JOB_CONTROL = 1
  933. const m__POSIX_MAPPED_FILES = 200112
  934. const m__POSIX_MEMLOCK_RANGE = 200112
  935. const m__POSIX_MEMORY_PROTECTION = 200112
  936. const m__POSIX_MESSAGE_PASSING = 200112
  937. const m__POSIX_MONOTONIC_CLOCK = 200112
  938. const m__POSIX_NO_TRUNC = 1
  939. const m__POSIX_PRIORITY_SCHEDULING = 0
  940. const m__POSIX_RAW_SOCKETS = 200112
  941. const m__POSIX_READER_WRITER_LOCKS = 200112
  942. const m__POSIX_REALTIME_SIGNALS = 200112
  943. const m__POSIX_REGEXP = 1
  944. const m__POSIX_SEMAPHORES = 200112
  945. const m__POSIX_SHARED_MEMORY_OBJECTS = 200112
  946. const m__POSIX_SHELL = 1
  947. const m__POSIX_SPAWN = 200112
  948. const m__POSIX_SPIN_LOCKS = 200112
  949. const m__POSIX_THREADS = 200112
  950. const m__POSIX_THREAD_ATTR_STACKADDR = 200112
  951. const m__POSIX_THREAD_ATTR_STACKSIZE = 200112
  952. const m__POSIX_THREAD_CPUTIME = 200112
  953. const m__POSIX_THREAD_PRIORITY_SCHEDULING = 200112
  954. const m__POSIX_THREAD_PRIO_INHERIT = 200112
  955. const m__POSIX_THREAD_PRIO_PROTECT = 200112
  956. const m__POSIX_THREAD_PROCESS_SHARED = 200112
  957. const m__POSIX_TIMEOUTS = 200112
  958. const m__POSIX_TIMERS = 200112
  959. const m__POSIX_VDISABLE = 0xff
  960. const m__POSIX_VERSION = 200112
  961. const m__QUAD_HIGHWORD = 1
  962. const m__QUAD_LOWWORD = 0
  963. const m__SC_2_CHAR_TERM = 20
  964. const m__SC_2_C_BIND = 18
  965. const m__SC_2_C_DEV = 19
  966. const m__SC_2_FORT_DEV = 21
  967. const m__SC_2_FORT_RUN = 22
  968. const m__SC_2_LOCALEDEF = 23
  969. const m__SC_2_PBS = 59
  970. const m__SC_2_PBS_ACCOUNTING = 60
  971. const m__SC_2_PBS_CHECKPOINT = 61
  972. const m__SC_2_PBS_LOCATE = 62
  973. const m__SC_2_PBS_MESSAGE = 63
  974. const m__SC_2_PBS_TRACK = 64
  975. const m__SC_2_SW_DEV = 24
  976. const m__SC_2_UPE = 25
  977. const m__SC_2_VERSION = 17
  978. const m__SC_ADVISORY_INFO = 65
  979. const m__SC_AIO_LISTIO_MAX = 42
  980. const m__SC_AIO_MAX = 43
  981. const m__SC_AIO_PRIO_DELTA_MAX = 44
  982. const m__SC_ARG_MAX = 1
  983. const m__SC_ASYNCHRONOUS_IO = 28
  984. const m__SC_ATEXIT_MAX = 107
  985. const m__SC_BARRIERS = 66
  986. const m__SC_BC_BASE_MAX = 9
  987. const m__SC_BC_DIM_MAX = 10
  988. const m__SC_BC_SCALE_MAX = 11
  989. const m__SC_BC_STRING_MAX = 12
  990. const m__SC_CHILD_MAX = 2
  991. const m__SC_CLK_TCK = 3
  992. const m__SC_CLOCK_SELECTION = 67
  993. const m__SC_COLL_WEIGHTS_MAX = 13
  994. const m__SC_CPUSET_SIZE = 122
  995. const m__SC_CPUTIME = 68
  996. const m__SC_DELAYTIMER_MAX = 45
  997. const m__SC_EXPR_NEST_MAX = 14
  998. const m__SC_FILE_LOCKING = 69
  999. const m__SC_FSYNC = 38
  1000. const m__SC_GETGR_R_SIZE_MAX = 70
  1001. const m__SC_GETPW_R_SIZE_MAX = 71
  1002. const m__SC_HOST_NAME_MAX = 72
  1003. const m__SC_IOV_MAX = 56
  1004. const m__SC_IPV6 = 118
  1005. const m__SC_JOB_CONTROL = 6
  1006. const m__SC_LINE_MAX = 15
  1007. const m__SC_LOGIN_NAME_MAX = 73
  1008. const m__SC_MAPPED_FILES = 29
  1009. const m__SC_MEMLOCK = 30
  1010. const m__SC_MEMLOCK_RANGE = 31
  1011. const m__SC_MEMORY_PROTECTION = 32
  1012. const m__SC_MESSAGE_PASSING = 33
  1013. const m__SC_MONOTONIC_CLOCK = 74
  1014. const m__SC_MQ_OPEN_MAX = 46
  1015. const m__SC_MQ_PRIO_MAX = 75
  1016. const m__SC_NGROUPS_MAX = 4
  1017. const m__SC_NPROCESSORS_CONF = 57
  1018. const m__SC_NPROCESSORS_ONLN = 58
  1019. const m__SC_OPEN_MAX = 5
  1020. const m__SC_PAGESIZE = 47
  1021. const m__SC_PAGE_SIZE = "_SC_PAGESIZE"
  1022. const m__SC_PHYS_PAGES = 121
  1023. const m__SC_PRIORITIZED_IO = 34
  1024. const m__SC_PRIORITY_SCHEDULING = 35
  1025. const m__SC_RAW_SOCKETS = 119
  1026. const m__SC_READER_WRITER_LOCKS = 76
  1027. const m__SC_REALTIME_SIGNALS = 36
  1028. const m__SC_REGEXP = 77
  1029. const m__SC_RE_DUP_MAX = 16
  1030. const m__SC_RTSIG_MAX = 48
  1031. const m__SC_SAVED_IDS = 7
  1032. const m__SC_SEMAPHORES = 37
  1033. const m__SC_SEM_NSEMS_MAX = 49
  1034. const m__SC_SEM_VALUE_MAX = 50
  1035. const m__SC_SHARED_MEMORY_OBJECTS = 39
  1036. const m__SC_SHELL = 78
  1037. const m__SC_SIGQUEUE_MAX = 51
  1038. const m__SC_SPAWN = 79
  1039. const m__SC_SPIN_LOCKS = 80
  1040. const m__SC_SPORADIC_SERVER = 81
  1041. const m__SC_STREAM_MAX = 26
  1042. const m__SC_SYMLOOP_MAX = 120
  1043. const m__SC_SYNCHRONIZED_IO = 40
  1044. const m__SC_THREADS = 96
  1045. const m__SC_THREAD_ATTR_STACKADDR = 82
  1046. const m__SC_THREAD_ATTR_STACKSIZE = 83
  1047. const m__SC_THREAD_CPUTIME = 84
  1048. const m__SC_THREAD_DESTRUCTOR_ITERATIONS = 85
  1049. const m__SC_THREAD_KEYS_MAX = 86
  1050. const m__SC_THREAD_PRIORITY_SCHEDULING = 89
  1051. const m__SC_THREAD_PRIO_INHERIT = 87
  1052. const m__SC_THREAD_PRIO_PROTECT = 88
  1053. const m__SC_THREAD_PROCESS_SHARED = 90
  1054. const m__SC_THREAD_SAFE_FUNCTIONS = 91
  1055. const m__SC_THREAD_SPORADIC_SERVER = 92
  1056. const m__SC_THREAD_STACK_MIN = 93
  1057. const m__SC_THREAD_THREADS_MAX = 94
  1058. const m__SC_TIMEOUTS = 95
  1059. const m__SC_TIMERS = 41
  1060. const m__SC_TIMER_MAX = 52
  1061. const m__SC_TRACE = 97
  1062. const m__SC_TRACE_EVENT_FILTER = 98
  1063. const m__SC_TRACE_INHERIT = 99
  1064. const m__SC_TRACE_LOG = 100
  1065. const m__SC_TTY_NAME_MAX = 101
  1066. const m__SC_TYPED_MEMORY_OBJECTS = 102
  1067. const m__SC_TZNAME_MAX = 27
  1068. const m__SC_V6_ILP32_OFF32 = 103
  1069. const m__SC_V6_ILP32_OFFBIG = 104
  1070. const m__SC_V6_LP64_OFF64 = 105
  1071. const m__SC_V6_LPBIG_OFFBIG = 106
  1072. const m__SC_VERSION = 8
  1073. const m__SC_XOPEN_CRYPT = 108
  1074. const m__SC_XOPEN_ENH_I18N = 109
  1075. const m__SC_XOPEN_LEGACY = 110
  1076. const m__SC_XOPEN_REALTIME = 111
  1077. const m__SC_XOPEN_REALTIME_THREADS = 112
  1078. const m__SC_XOPEN_SHM = 113
  1079. const m__SC_XOPEN_STREAMS = 114
  1080. const m__SC_XOPEN_UNIX = 115
  1081. const m__SC_XOPEN_VERSION = 116
  1082. const m__SC_XOPEN_XCU_VERSION = 117
  1083. const m__SIG_MAXSIG = 128
  1084. const m__SIG_WORDS = 4
  1085. const m__V6_ILP32_OFFBIG = 0
  1086. const m__V6_LP64_OFF64 = 0
  1087. const m__XOPEN_SHM = 1
  1088. const m_fds_bits = "__fds_bits"
  1089. const m_static_assert = "_Static_assert"
  1090. type Tpthread_once = struct {
  1091. Fstate int32
  1092. Fmutex Tpthread_mutex_t
  1093. }
  1094. type Tpthread_t = uintptr
  1095. type Tpthread_attr_t = uintptr
  1096. type Tpthread_mutex_t = uintptr
  1097. type Tpthread_mutexattr_t = uintptr
  1098. type Tpthread_cond_t = uintptr
  1099. type Tpthread_condattr_t = uintptr
  1100. type Tpthread_key_t = int32
  1101. type Tpthread_once_t = struct {
  1102. Fstate int32
  1103. Fmutex Tpthread_mutex_t
  1104. }
  1105. type Tpthread_rwlock_t = uintptr
  1106. type Tpthread_rwlockattr_t = uintptr
  1107. type Tpthread_barrier_t = uintptr
  1108. type Tpthread_barrierattr_t = uintptr
  1109. type Tpthread_spinlock_t = uintptr
  1110. type Tpthread_addr_t = uintptr
  1111. type Tpthread_startroutine_t = uintptr
  1112. type Tu_char = uint8
  1113. type Tu_short = uint16
  1114. type Tu_int = uint32
  1115. type Tu_long = uint64
  1116. type Tushort = uint16
  1117. type Tuint = uint32
  1118. type Tint8_t = int8
  1119. type Tint16_t = int16
  1120. type Tint32_t = int32
  1121. type Tint64_t = int64
  1122. type Tuint8_t = uint8
  1123. type Tuint16_t = uint16
  1124. type Tuint32_t = uint32
  1125. type Tuint64_t = uint64
  1126. type Tintptr_t = int64
  1127. type Tuintptr_t = uint64
  1128. type Tintmax_t = int64
  1129. type Tuintmax_t = uint64
  1130. type Tu_int8_t = uint8
  1131. type Tu_int16_t = uint16
  1132. type Tu_int32_t = uint32
  1133. type Tu_int64_t = uint64
  1134. type Tu_quad_t = uint64
  1135. type Tquad_t = int64
  1136. type Tqaddr_t = uintptr
  1137. type Tcaddr_t = uintptr
  1138. type Tc_caddr_t = uintptr
  1139. type Tblksize_t = int32
  1140. type Tcpuwhich_t = int32
  1141. type Tcpulevel_t = int32
  1142. type Tcpusetid_t = int32
  1143. type Tblkcnt_t = int64
  1144. type Tclock_t = int32
  1145. type Tclockid_t = int32
  1146. type Tcritical_t = int64
  1147. type Tdaddr_t = int64
  1148. type Tdev_t = uint64
  1149. type Tfflags_t = uint32
  1150. type Tfixpt_t = uint32
  1151. type Tfsblkcnt_t = uint64
  1152. type Tfsfilcnt_t = uint64
  1153. type Tgid_t = uint32
  1154. type Tin_addr_t = uint32
  1155. type Tin_port_t = uint16
  1156. type Tid_t = int64
  1157. type Tino_t = uint64
  1158. type Tkey_t = int64
  1159. type Tlwpid_t = int32
  1160. type Taccmode_t = int32
  1161. type Tnlink_t = uint64
  1162. type Tpid_t = int32
  1163. type Tregister_t = int64
  1164. type Trlim_t = int64
  1165. type Tsbintime_t = int64
  1166. type Tsegsz_t = int64
  1167. type Tsuseconds_t = int64
  1168. type Ttime_t = int64
  1169. type Ttimer_t = uintptr
  1170. type Tmqd_t = uintptr
  1171. type Tu_register_t = uint64
  1172. type Tuid_t = uint32
  1173. type Tuseconds_t = uint32
  1174. type Tcap_ioctl_t = uint64
  1175. type Tkpaddr_t = uint64
  1176. type Tkvaddr_t = uint64
  1177. type Tksize_t = uint64
  1178. type Tkssize_t = int64
  1179. type Tvm_offset_t = uint64
  1180. type Tvm_ooffset_t = uint64
  1181. type Tvm_paddr_t = uint64
  1182. type Tvm_pindex_t = uint64
  1183. type Tvm_size_t = uint64
  1184. type Trman_res_t = uint64
  1185. type Tsyscallarg_t = int64
  1186. type t__sigset_t = struct {
  1187. F__bits [4]t__uint32_t
  1188. }
  1189. type t__sigset = t__sigset_t
  1190. type Ttimeval = struct {
  1191. Ftv_sec Ttime_t
  1192. Ftv_usec Tsuseconds_t
  1193. }
  1194. type Ttimespec = struct {
  1195. Ftv_sec Ttime_t
  1196. Ftv_nsec int64
  1197. }
  1198. type Titimerspec = struct {
  1199. Fit_interval Ttimespec
  1200. Fit_value Ttimespec
  1201. }
  1202. type t__fd_mask = uint64
  1203. type Tfd_mask = uint64
  1204. type Tsigset_t = struct {
  1205. F__bits [4]t__uint32_t
  1206. }
  1207. type Tfd_set = struct {
  1208. F__fds_bits [16]t__fd_mask
  1209. }
  1210. type Tflock = struct {
  1211. Fl_start Toff_t
  1212. Fl_len Toff_t
  1213. Fl_pid Tpid_t
  1214. Fl_type int16
  1215. Fl_whence int16
  1216. Fl_sysid int32
  1217. }
  1218. type t__oflock = struct {
  1219. Fl_start Toff_t
  1220. Fl_len Toff_t
  1221. Fl_pid Tpid_t
  1222. Fl_type int16
  1223. Fl_whence int16
  1224. }
  1225. type Tspacectl_range = struct {
  1226. Fr_offset Toff_t
  1227. Fr_len Toff_t
  1228. }
  1229. type Tcrypt_data = struct {
  1230. Finitialized int32
  1231. F__buf [256]int8
  1232. }
  1233. type Ttimezone = struct {
  1234. Ftz_minuteswest int32
  1235. Ftz_dsttime int32
  1236. }
  1237. type Tbintime = struct {
  1238. Fsec Ttime_t
  1239. Ffrac Tuint64_t
  1240. }
  1241. type Titimerval = struct {
  1242. Fit_interval Ttimeval
  1243. Fit_value Ttimeval
  1244. }
  1245. type Tclockinfo = struct {
  1246. Fhz int32
  1247. Ftick int32
  1248. Fspare int32
  1249. Fstathz int32
  1250. Fprofhz int32
  1251. }
  1252. type Ttm = struct {
  1253. Ftm_sec int32
  1254. Ftm_min int32
  1255. Ftm_hour int32
  1256. Ftm_mday int32
  1257. Ftm_mon int32
  1258. Ftm_year int32
  1259. Ftm_wday int32
  1260. Ftm_yday int32
  1261. Ftm_isdst int32
  1262. Ftm_gmtoff int64
  1263. Ftm_zone uintptr
  1264. }
  1265. var _buf = libc.UintptrFromInt32(0)
  1266. func _free_filename_buffer(tls *libc.TLS) {
  1267. libc.Xfree(tls, _buf)
  1268. _buf = libc.UintptrFromInt32(0)
  1269. }
  1270. func XXauFileName(tls *libc.TLS) (r uintptr) {
  1271. bp := tls.Alloc(32)
  1272. defer tls.Free(32)
  1273. var name, slashDotXauthority, v1 uintptr
  1274. var size Tsize_t
  1275. var v2 int32
  1276. _, _, _, _, _ = name, size, slashDotXauthority, v1, v2
  1277. slashDotXauthority = __ccgo_ts
  1278. v1 = libc.Xgetenv(tls, __ccgo_ts+13)
  1279. name = v1
  1280. if v1 != 0 {
  1281. return name
  1282. }
  1283. name = libc.Xgetenv(tls, __ccgo_ts+24)
  1284. if !(name != 0) {
  1285. return libc.UintptrFromInt32(0)
  1286. }
  1287. size = libc.Xstrlen(tls, name) + libc.Xstrlen(tls, slashDotXauthority+1) + uint64(2)
  1288. if size > _bsize || _buf == libc.UintptrFromInt32(0) {
  1289. libc.Xfree(tls, _buf)
  1290. _buf = libc.Xmalloc(tls, size)
  1291. if !(_buf != 0) {
  1292. _bsize = uint64(0)
  1293. return libc.UintptrFromInt32(0)
  1294. }
  1295. if !(_atexit_registered != 0) {
  1296. libc.Xatexit(tls, __ccgo_fp(_free_filename_buffer))
  1297. _atexit_registered = int32(1)
  1298. }
  1299. _bsize = size
  1300. }
  1301. if int32(*(*int8)(unsafe.Pointer(name))) == int32('/') && int32(*(*int8)(unsafe.Pointer(name + 1))) == int32('\000') {
  1302. v2 = int32(1)
  1303. } else {
  1304. v2 = 0
  1305. }
  1306. libc.X__builtin_snprintf(tls, _buf, _bsize, __ccgo_ts+29, libc.VaList(bp+8, name, slashDotXauthority+uintptr(v2)))
  1307. return _buf
  1308. }
  1309. var _bsize Tsize_t
  1310. var _atexit_registered int32
  1311. const m_R_OK1 = 4
  1312. /*-
  1313. * SPDX-License-Identifier: BSD-3-Clause
  1314. *
  1315. * Copyright (c) 1989, 1993
  1316. * The Regents of the University of California. All rights reserved.
  1317. * (c) UNIX System Laboratories, Inc.
  1318. * All or some portions of this file are derived from material licensed
  1319. * to the University of California by American Telephone and Telegraph
  1320. * Co. or Unix System Laboratories, Inc. and are reproduced herein with
  1321. * the permission of UNIX System Laboratories, Inc.
  1322. *
  1323. * Redistribution and use in source and binary forms, with or without
  1324. * modification, are permitted provided that the following conditions
  1325. * are met:
  1326. * 1. Redistributions of source code must retain the above copyright
  1327. * notice, this list of conditions and the following disclaimer.
  1328. * 2. Redistributions in binary form must reproduce the above copyright
  1329. * notice, this list of conditions and the following disclaimer in the
  1330. * documentation and/or other materials provided with the distribution.
  1331. * 3. Neither the name of the University nor the names of its contributors
  1332. * may be used to endorse or promote products derived from this software
  1333. * without specific prior written permission.
  1334. *
  1335. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1336. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1337. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1338. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1339. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1340. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1341. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1342. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1343. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1344. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1345. * SUCH DAMAGE.
  1346. *
  1347. * @(#)time.h 8.3 (Berkeley) 1/21/94
  1348. */
  1349. /*
  1350. */
  1351. /* define X_GETTIMEOFDAY macro, a portable gettimeofday() */
  1352. /* use POSIX name for signal */
  1353. /*
  1354. * Copyright 1997 Metro Link Incorporated
  1355. *
  1356. * All Rights Reserved
  1357. *
  1358. * Permission to use, copy, modify, distribute, and sell this software and its
  1359. * documentation for any purpose is hereby granted without fee, provided that
  1360. * the above copyright notice appear in all copies and that both that
  1361. * copyright notice and this permission notice appear in supporting
  1362. * documentation, and that the names of the above listed copyright holder(s)
  1363. * not be used in advertising or publicity pertaining to distribution of
  1364. * the software without specific, written prior permission. The above listed
  1365. * copyright holder(s) make(s) no representations about the suitability of
  1366. * this software for any purpose. It is provided "as is" without express or
  1367. * implied warranty.
  1368. *
  1369. * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD
  1370. * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  1371. * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
  1372. * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
  1373. * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
  1374. * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
  1375. * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  1376. */
  1377. /*
  1378. * Determine the machine's byte order.
  1379. */
  1380. /* See if it is set in the imake config first */
  1381. /*-
  1382. * This file is in the public domain.
  1383. */
  1384. /*-
  1385. * SPDX-License-Identifier: BSD-3-Clause
  1386. *
  1387. * Copyright (c) 1987, 1991 Regents of the University of California.
  1388. * All rights reserved.
  1389. *
  1390. * Redistribution and use in source and binary forms, with or without
  1391. * modification, are permitted provided that the following conditions
  1392. * are met:
  1393. * 1. Redistributions of source code must retain the above copyright
  1394. * notice, this list of conditions and the following disclaimer.
  1395. * 2. Redistributions in binary form must reproduce the above copyright
  1396. * notice, this list of conditions and the following disclaimer in the
  1397. * documentation and/or other materials provided with the distribution.
  1398. * 3. Neither the name of the University nor the names of its contributors
  1399. * may be used to endorse or promote products derived from this software
  1400. * without specific prior written permission.
  1401. *
  1402. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1403. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1404. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1405. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1406. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1407. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1408. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1409. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1410. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1411. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1412. * SUCH DAMAGE.
  1413. *
  1414. * @(#)endian.h 7.8 (Berkeley) 4/3/91
  1415. */
  1416. func XXauGetAuthByAddr(tls *libc.TLS, family uint16, address_length uint16, address uintptr, number_length uint16, number uintptr, name_length uint16, name uintptr) (r uintptr) {
  1417. var auth_file, auth_name, entry uintptr
  1418. _, _, _ = auth_file, auth_name, entry
  1419. auth_name = XXauFileName(tls)
  1420. if !(auth_name != 0) {
  1421. return libc.UintptrFromInt32(0)
  1422. }
  1423. if libc.Xaccess(tls, auth_name, int32(m_R_OK1)) != 0 { /* checks REAL id */
  1424. return libc.UintptrFromInt32(0)
  1425. }
  1426. auth_file = libc.Xfopen(tls, auth_name, __ccgo_ts+34)
  1427. if !(auth_file != 0) {
  1428. return libc.UintptrFromInt32(0)
  1429. }
  1430. for {
  1431. entry = XXauReadAuth(tls, auth_file)
  1432. if !(entry != 0) {
  1433. break
  1434. }
  1435. /*
  1436. * Match when:
  1437. * either family or entry->family are FamilyWild or
  1438. * family and entry->family are the same and
  1439. * address and entry->address are the same
  1440. * and
  1441. * either number or entry->number are empty or
  1442. * number and entry->number are the same
  1443. * and
  1444. * either name or entry->name are empty or
  1445. * name and entry->name are the same
  1446. */
  1447. 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) {
  1448. break
  1449. }
  1450. XXauDisposeAuth(tls, entry)
  1451. goto _1
  1452. _1:
  1453. }
  1454. libc.Xfclose(tls, auth_file)
  1455. return entry
  1456. }
  1457. const m_CPUSET_DEFAULT = 0
  1458. const m_CPU_LEVEL_CPUSET = 2
  1459. const m_CPU_LEVEL_ROOT = 1
  1460. const m_CPU_LEVEL_WHICH = 3
  1461. const m_CPU_MAXSIZE = 1024
  1462. const m_CPU_SETSIZE = "CPU_MAXSIZE"
  1463. const m_CPU_WHICH_CPUSET = 3
  1464. const m_CPU_WHICH_DOMAIN = 6
  1465. const m_CPU_WHICH_INTRHANDLER = 7
  1466. const m_CPU_WHICH_IRQ = 4
  1467. const m_CPU_WHICH_ITHREAD = 8
  1468. const m_CPU_WHICH_JAIL = 5
  1469. const m_CPU_WHICH_PID = 2
  1470. const m_CPU_WHICH_TID = 1
  1471. const m_CPU_WHICH_TIDPID = 9
  1472. const m_PTHREAD_CANCEL_ASYNCHRONOUS = 2
  1473. const m_PTHREAD_CANCEL_DEFERRED = 0
  1474. const m_PTHREAD_CANCEL_DISABLE = 1
  1475. const m_PTHREAD_CANCEL_ENABLE = 0
  1476. const m_PTHREAD_COND_INITIALIZER = "NULL"
  1477. const m_PTHREAD_CREATE_DETACHED = "PTHREAD_DETACHED"
  1478. const m_PTHREAD_CREATE_JOINABLE = 0
  1479. const m_PTHREAD_DESTRUCTOR_ITERATIONS = 4
  1480. const m_PTHREAD_DETACHED = 0x1
  1481. const m_PTHREAD_DONE_INIT = 1
  1482. const m_PTHREAD_EXPLICIT_SCHED = 0
  1483. const m_PTHREAD_INHERIT_SCHED = 0x4
  1484. const m_PTHREAD_KEYS_MAX = 256
  1485. const m_PTHREAD_MUTEX_DEFAULT = "PTHREAD_MUTEX_ERRORCHECK"
  1486. const m_PTHREAD_MUTEX_INITIALIZER = "NULL"
  1487. const m_PTHREAD_MUTEX_ROBUST = 1
  1488. const m_PTHREAD_MUTEX_STALLED = 0
  1489. const m_PTHREAD_NEEDS_INIT = 0
  1490. const m_PTHREAD_NOFLOAT = 0x8
  1491. const m_PTHREAD_PRIO_INHERIT = 1
  1492. const m_PTHREAD_PRIO_NONE = 0
  1493. const m_PTHREAD_PRIO_PROTECT = 2
  1494. const m_PTHREAD_PROCESS_PRIVATE = 0
  1495. const m_PTHREAD_PROCESS_SHARED = 1
  1496. const m_PTHREAD_RWLOCK_INITIALIZER = "NULL"
  1497. const m_PTHREAD_SCOPE_PROCESS = 0
  1498. const m_PTHREAD_SCOPE_SYSTEM = 0x2
  1499. const m_PTHREAD_STACK_MIN = "__MINSIGSTKSZ"
  1500. const m_PTHREAD_THREADS_MAX = "__ULONG_MAX"
  1501. const m_SCHED_FIFO = 1
  1502. const m_SCHED_OTHER = 2
  1503. const m_SCHED_RR = 3
  1504. const m_XMUTEX_INITIALIZER = "PTHREAD_MUTEX_INITIALIZER"
  1505. const m__NCPUBITS = "_BITSET_BITS"
  1506. const m_pthread_attr_default = "NULL"
  1507. const m_pthread_condattr_default = "NULL"
  1508. const m_pthread_mutexattr_default = "NULL"
  1509. const m_xfree = "free"
  1510. const m_xmalloc = "malloc"
  1511. const m_xthread_self = "pthread_self"
  1512. type Tsigval = struct {
  1513. Fsival_ptr [0]uintptr
  1514. Fsigval_int [0]int32
  1515. Fsigval_ptr [0]uintptr
  1516. Fsival_int int32
  1517. F__ccgo_pad4 [4]byte
  1518. }
  1519. type Tsched_param = struct {
  1520. Fsched_priority int32
  1521. }
  1522. type T_cpuset = struct {
  1523. F__bits [16]int64
  1524. }
  1525. type Tcpuset_t = struct {
  1526. F__bits [16]int64
  1527. }
  1528. type Tcpu_set_t = struct {
  1529. F__bits [16]int64
  1530. }
  1531. type _pthread_mutextype = int32
  1532. const _PTHREAD_MUTEX_ERRORCHECK = 1
  1533. const _PTHREAD_MUTEX_RECURSIVE = 2
  1534. const _PTHREAD_MUTEX_NORMAL = 3
  1535. const _PTHREAD_MUTEX_ADAPTIVE_NP = 4
  1536. const _PTHREAD_MUTEX_TYPE_MAX = 5
  1537. type T_pthread_cleanup_info = struct {
  1538. Fpthread_cleanup_pad [8]t__uintptr_t
  1539. }
  1540. type Txthread_t = uintptr
  1541. type Txthread_key_t = int32
  1542. type Txcondition_rec = uintptr
  1543. type Txmutex_rec = uintptr
  1544. type Txcondition_t = uintptr
  1545. type Txmutex_t = uintptr
  1546. /* aids understood by some debuggers */
  1547. 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) {
  1548. var auth_file, auth_name, best, entry uintptr
  1549. var best_type, type1 int32
  1550. _, _, _, _, _, _ = auth_file, auth_name, best, best_type, entry, type1
  1551. auth_name = XXauFileName(tls)
  1552. if !(auth_name != 0) {
  1553. return libc.UintptrFromInt32(0)
  1554. }
  1555. if libc.Xaccess(tls, auth_name, int32(m_R_OK1)) != 0 { /* checks REAL id */
  1556. return libc.UintptrFromInt32(0)
  1557. }
  1558. auth_file = libc.Xfopen(tls, auth_name, __ccgo_ts+34)
  1559. if !(auth_file != 0) {
  1560. return libc.UintptrFromInt32(0)
  1561. }
  1562. best = libc.UintptrFromInt32(0)
  1563. best_type = types_length
  1564. for {
  1565. entry = XXauReadAuth(tls, auth_file)
  1566. if !(entry != 0) {
  1567. break
  1568. }
  1569. /*
  1570. * Match when:
  1571. * either family or entry->family are FamilyWild or
  1572. * family and entry->family are the same and
  1573. * address and entry->address are the same
  1574. * and
  1575. * either number or entry->number are empty or
  1576. * number and entry->number are the same
  1577. * and
  1578. * either name or entry->name are empty or
  1579. * name and entry->name are the same
  1580. */
  1581. 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) {
  1582. if best_type == 0 {
  1583. best = entry
  1584. break
  1585. }
  1586. type1 = 0
  1587. for {
  1588. if !(type1 < best_type) {
  1589. break
  1590. }
  1591. 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) {
  1592. break
  1593. }
  1594. goto _2
  1595. _2:
  1596. ;
  1597. type1++
  1598. }
  1599. if type1 < best_type {
  1600. if best != 0 {
  1601. XXauDisposeAuth(tls, best)
  1602. }
  1603. best = entry
  1604. best_type = type1
  1605. if type1 == 0 {
  1606. break
  1607. }
  1608. goto _1
  1609. }
  1610. }
  1611. XXauDisposeAuth(tls, entry)
  1612. goto _1
  1613. _1:
  1614. }
  1615. libc.Xfclose(tls, auth_file)
  1616. return best
  1617. }
  1618. const m_E2BIG = 7
  1619. const m_EACCES = 13
  1620. const m_EADDRINUSE = 48
  1621. const m_EADDRNOTAVAIL = 49
  1622. const m_EAFNOSUPPORT = 47
  1623. const m_EAGAIN = 35
  1624. const m_EALREADY = 37
  1625. const m_EAUTH = 80
  1626. const m_EBADF = 9
  1627. const m_EBADMSG = 89
  1628. const m_EBADRPC = 72
  1629. const m_EBUSY = 16
  1630. const m_ECANCELED = 85
  1631. const m_ECAPMODE = 94
  1632. const m_ECHILD = 10
  1633. const m_ECONNABORTED = 53
  1634. const m_ECONNREFUSED = 61
  1635. const m_ECONNRESET = 54
  1636. const m_EDEADLK = 11
  1637. const m_EDESTADDRREQ = 39
  1638. const m_EDOM = 33
  1639. const m_EDOOFUS = 88
  1640. const m_EDQUOT = 69
  1641. const m_EEXIST = 17
  1642. const m_EFAULT = 14
  1643. const m_EFBIG = 27
  1644. const m_EFTYPE = 79
  1645. const m_EHOSTDOWN = 64
  1646. const m_EHOSTUNREACH = 65
  1647. const m_EIDRM = 82
  1648. const m_EILSEQ = 86
  1649. const m_EINPROGRESS = 36
  1650. const m_EINTEGRITY = 97
  1651. const m_EINTR = 4
  1652. const m_EINVAL = 22
  1653. const m_EIO = 5
  1654. const m_EISCONN = 56
  1655. const m_EISDIR = 21
  1656. const m_ELAST = 97
  1657. const m_ELOOP = 62
  1658. const m_EMFILE = 24
  1659. const m_EMLINK = 31
  1660. const m_EMSGSIZE = 40
  1661. const m_EMULTIHOP = 90
  1662. const m_ENAMETOOLONG = 63
  1663. const m_ENEEDAUTH = 81
  1664. const m_ENETDOWN = 50
  1665. const m_ENETRESET = 52
  1666. const m_ENETUNREACH = 51
  1667. const m_ENFILE = 23
  1668. const m_ENOATTR = 87
  1669. const m_ENOBUFS = 55
  1670. const m_ENODEV = 19
  1671. const m_ENOENT = 2
  1672. const m_ENOEXEC = 8
  1673. const m_ENOLCK = 77
  1674. const m_ENOLINK = 91
  1675. const m_ENOMEM = 12
  1676. const m_ENOMSG = 83
  1677. const m_ENOPROTOOPT = 42
  1678. const m_ENOSPC = 28
  1679. const m_ENOSYS = 78
  1680. const m_ENOTBLK = 15
  1681. const m_ENOTCAPABLE = 93
  1682. const m_ENOTCONN = 57
  1683. const m_ENOTDIR = 20
  1684. const m_ENOTEMPTY = 66
  1685. const m_ENOTRECOVERABLE = 95
  1686. const m_ENOTSOCK = 38
  1687. const m_ENOTSUP = "EOPNOTSUPP"
  1688. const m_ENOTTY = 25
  1689. const m_ENXIO = 6
  1690. const m_EOPNOTSUPP = 45
  1691. const m_EOVERFLOW = 84
  1692. const m_EOWNERDEAD = 96
  1693. const m_EPERM = 1
  1694. const m_EPFNOSUPPORT = 46
  1695. const m_EPIPE = 32
  1696. const m_EPROCLIM = 67
  1697. const m_EPROCUNAVAIL = 76
  1698. const m_EPROGMISMATCH = 75
  1699. const m_EPROGUNAVAIL = 74
  1700. const m_EPROTO = 92
  1701. const m_EPROTONOSUPPORT = 43
  1702. const m_EPROTOTYPE = 41
  1703. const m_ERANGE = 34
  1704. const m_EREMOTE = 71
  1705. const m_EROFS = 30
  1706. const m_ERPCMISMATCH = 73
  1707. const m_ESHUTDOWN = 58
  1708. const m_ESOCKTNOSUPPORT = 44
  1709. const m_ESPIPE = 29
  1710. const m_ESRCH = 3
  1711. const m_ESTALE = 70
  1712. const m_ETIMEDOUT = 60
  1713. const m_ETOOMANYREFS = 59
  1714. const m_ETXTBSY = 26
  1715. const m_EUSERS = 68
  1716. const m_EWOULDBLOCK = "EAGAIN"
  1717. const m_EXDEV = 18
  1718. const m_O_CREAT1 = 512
  1719. const m_O_EXCL1 = 2048
  1720. const m_O_WRONLY1 = 1
  1721. const m_R_OK2 = 0x04
  1722. const m_SF_APPEND = 0x00040000
  1723. const m_SF_ARCHIVED = 0x00010000
  1724. const m_SF_IMMUTABLE = 0x00020000
  1725. const m_SF_NOUNLINK = 0x00100000
  1726. const m_SF_SETTABLE = 0xffff0000
  1727. const m_SF_SNAPSHOT = 0x00200000
  1728. const m_S_BLKSIZE = 512
  1729. const m_S_IEXEC = "S_IXUSR"
  1730. const m_S_IFBLK = 0060000
  1731. const m_S_IFCHR = 0020000
  1732. const m_S_IFDIR = 0040000
  1733. const m_S_IFIFO = 0010000
  1734. const m_S_IFLNK = 0120000
  1735. const m_S_IFMT = 0170000
  1736. const m_S_IFREG = 0100000
  1737. const m_S_IFSOCK = 0140000
  1738. const m_S_IFWHT = 0160000
  1739. const m_S_IREAD = "S_IRUSR"
  1740. const m_S_IRGRP = 0000040
  1741. const m_S_IROTH = 0000004
  1742. const m_S_IRUSR = 0000400
  1743. const m_S_IRWXG = 0000070
  1744. const m_S_IRWXO = 0000007
  1745. const m_S_IRWXU = 0000700
  1746. const m_S_ISGID = 0002000
  1747. const m_S_ISTXT = 0001000
  1748. const m_S_ISUID = 0004000
  1749. const m_S_ISVTX = 0001000
  1750. const m_S_IWGRP = 0000020
  1751. const m_S_IWOTH = 0000002
  1752. const m_S_IWRITE = "S_IWUSR"
  1753. const m_S_IWUSR = 0000200
  1754. const m_S_IXGRP = 0000010
  1755. const m_S_IXOTH = 0000001
  1756. const m_S_IXUSR = 0000100
  1757. const m_Time_t = "time_t"
  1758. const m_UF_APPEND = 0x00000004
  1759. const m_UF_ARCHIVE = 0x00000800
  1760. const m_UF_HIDDEN = 0x00008000
  1761. const m_UF_IMMUTABLE = 0x00000002
  1762. const m_UF_NODUMP = 0x00000001
  1763. const m_UF_NOUNLINK = 0x00000010
  1764. const m_UF_OFFLINE = 0x00000200
  1765. const m_UF_OPAQUE = 0x00000008
  1766. const m_UF_READONLY = 0x00001000
  1767. const m_UF_REPARSE = 0x00000400
  1768. const m_UF_SETTABLE = 0x0000ffff
  1769. const m_UF_SPARSE = 0x00000100
  1770. const m_UF_SYSTEM = 0x00000080
  1771. const m_st_atimespec = "st_atim"
  1772. const m_st_birthtimespec = "st_birthtim"
  1773. const m_st_ctimespec = "st_ctim"
  1774. const m_st_mtimespec = "st_mtim"
  1775. type Tstat = struct {
  1776. Fst_dev Tdev_t
  1777. Fst_ino Tino_t
  1778. Fst_nlink Tnlink_t
  1779. Fst_mode Tmode_t
  1780. Fst_padding0 t__int16_t
  1781. Fst_uid Tuid_t
  1782. Fst_gid Tgid_t
  1783. Fst_padding1 t__int32_t
  1784. Fst_rdev Tdev_t
  1785. Fst_atim Ttimespec
  1786. Fst_mtim Ttimespec
  1787. Fst_ctim Ttimespec
  1788. Fst_birthtim Ttimespec
  1789. Fst_size Toff_t
  1790. Fst_blocks Tblkcnt_t
  1791. Fst_blksize Tblksize_t
  1792. Fst_flags Tfflags_t
  1793. Fst_gen t__uint64_t
  1794. Fst_spare [10]t__uint64_t
  1795. }
  1796. /* 11 was EAGAIN */
  1797. /* math software */
  1798. /* non-blocking and interrupt i/o */
  1799. /* ipc/network software -- argument errors */
  1800. /* ipc/network software -- operational errors */
  1801. /* should be rearranged */
  1802. /* quotas & mush */
  1803. /* Network File System */
  1804. /* ISO/IEC 9899:2011 K.3.2.2 */
  1805. /*-
  1806. * SPDX-License-Identifier: BSD-3-Clause
  1807. *
  1808. * Copyright (c) 1989, 1993
  1809. * The Regents of the University of California. All rights reserved.
  1810. * (c) UNIX System Laboratories, Inc.
  1811. * All or some portions of this file are derived from material licensed
  1812. * to the University of California by American Telephone and Telegraph
  1813. * Co. or Unix System Laboratories, Inc. and are reproduced herein with
  1814. * the permission of UNIX System Laboratories, Inc.
  1815. *
  1816. * Redistribution and use in source and binary forms, with or without
  1817. * modification, are permitted provided that the following conditions
  1818. * are met:
  1819. * 1. Redistributions of source code must retain the above copyright
  1820. * notice, this list of conditions and the following disclaimer.
  1821. * 2. Redistributions in binary form must reproduce the above copyright
  1822. * notice, this list of conditions and the following disclaimer in the
  1823. * documentation and/or other materials provided with the distribution.
  1824. * 3. Neither the name of the University nor the names of its contributors
  1825. * may be used to endorse or promote products derived from this software
  1826. * without specific prior written permission.
  1827. *
  1828. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1829. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1830. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1831. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1832. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1833. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1834. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1835. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1836. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1837. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1838. * SUCH DAMAGE.
  1839. *
  1840. * @(#)time.h 8.3 (Berkeley) 1/21/94
  1841. */
  1842. /*
  1843. */
  1844. /*-
  1845. * SPDX-License-Identifier: BSD-3-Clause
  1846. *
  1847. * Copyright (c) 1991, 1993, 1994
  1848. * The Regents of the University of California. All rights reserved.
  1849. *
  1850. * Redistribution and use in source and binary forms, with or without
  1851. * modification, are permitted provided that the following conditions
  1852. * are met:
  1853. * 1. Redistributions of source code must retain the above copyright
  1854. * notice, this list of conditions and the following disclaimer.
  1855. * 2. Redistributions in binary form must reproduce the above copyright
  1856. * notice, this list of conditions and the following disclaimer in the
  1857. * documentation and/or other materials provided with the distribution.
  1858. * 3. Neither the name of the University nor the names of its contributors
  1859. * may be used to endorse or promote products derived from this software
  1860. * without specific prior written permission.
  1861. *
  1862. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1863. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1864. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1865. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1866. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1867. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1868. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1869. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1870. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1871. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1872. * SUCH DAMAGE.
  1873. *
  1874. * @(#)unistd.h 8.12 (Berkeley) 4/27/95
  1875. */
  1876. func XXauLockAuth(tls *libc.TLS, file_name uintptr, retries int32, timeout int32, dead int64) (r int32) {
  1877. bp := tls.Alloc(2304)
  1878. defer tls.Free(2304)
  1879. var creat_fd int32
  1880. var now Ttime_t
  1881. var _ /* creat_name at bp+0 */ [1025]int8
  1882. var _ /* link_name at bp+1025 */ [1025]int8
  1883. var _ /* statb at bp+2056 */ Tstat
  1884. _, _ = creat_fd, now
  1885. creat_fd = -int32(1)
  1886. if libc.Xstrlen(tls, file_name) > uint64(1022) {
  1887. return int32(m_LOCK_ERROR)
  1888. }
  1889. libc.X__builtin_snprintf(tls, bp, uint64(1025), __ccgo_ts+37, libc.VaList(bp+2288, file_name))
  1890. libc.X__builtin_snprintf(tls, bp+1025, uint64(1025), __ccgo_ts+42, libc.VaList(bp+2288, file_name))
  1891. if libc.Xstat(tls, bp, bp+2056) != -int32(1) {
  1892. now = libc.Xtime(tls, libc.UintptrFromInt32(0))
  1893. /*
  1894. * NFS may cause ctime to be before now, special
  1895. * case a 0 deadtime to force lock removal
  1896. */
  1897. if dead == 0 || now-(*(*Tstat)(unsafe.Pointer(bp + 2056))).Fst_ctim.Ftv_sec > dead {
  1898. libc.Xremove(tls, bp)
  1899. libc.Xremove(tls, bp+1025)
  1900. }
  1901. }
  1902. for retries > 0 {
  1903. if creat_fd == -int32(1) {
  1904. creat_fd = libc.Xopen(tls, bp, libc.Int32FromInt32(m_O_WRONLY1)|libc.Int32FromInt32(m_O_CREAT1)|libc.Int32FromInt32(m_O_EXCL1), libc.VaList(bp+2288, int32(0600)))
  1905. if creat_fd == -int32(1) {
  1906. if *(*int32)(unsafe.Pointer(libc.X__error(tls))) != int32(m_EACCES) && *(*int32)(unsafe.Pointer(libc.X__error(tls))) != int32(m_EEXIST) {
  1907. return int32(m_LOCK_ERROR)
  1908. }
  1909. } else {
  1910. libc.Xclose(tls, creat_fd)
  1911. }
  1912. }
  1913. if creat_fd != -int32(1) {
  1914. /* The file system may not support hard links, and pathconf should tell us that. */
  1915. if int64(1) == libc.Xpathconf(tls, bp, int32(m__PC_LINK_MAX)) {
  1916. if -int32(1) == libc.Xrename(tls, bp, bp+1025) {
  1917. /* Is this good enough? Perhaps we should retry. TEST */
  1918. return int32(m_LOCK_ERROR)
  1919. } else {
  1920. return m_LOCK_SUCCESS
  1921. }
  1922. } else {
  1923. if libc.Xlink(tls, bp, bp+1025) != -int32(1) {
  1924. return m_LOCK_SUCCESS
  1925. }
  1926. if *(*int32)(unsafe.Pointer(libc.X__error(tls))) == int32(m_ENOENT) {
  1927. creat_fd = -int32(1) /* force re-creat next time around */
  1928. continue
  1929. }
  1930. if *(*int32)(unsafe.Pointer(libc.X__error(tls))) != int32(m_EEXIST) {
  1931. return int32(m_LOCK_ERROR)
  1932. }
  1933. }
  1934. }
  1935. libc.Xsleep(tls, libc.Uint32FromInt32(timeout))
  1936. retries--
  1937. }
  1938. return int32(m_LOCK_TIMEOUT)
  1939. }
  1940. func _read_short(tls *libc.TLS, shortp uintptr, file uintptr) (r int32) {
  1941. bp := tls.Alloc(16)
  1942. defer tls.Free(16)
  1943. var _ /* file_short at bp+0 */ [2]uint8
  1944. if libc.Xfread(tls, bp, uint64(2), uint64(1), file) != uint64(1) {
  1945. return 0
  1946. }
  1947. *(*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)]))
  1948. return int32(1)
  1949. }
  1950. func _read_counted_string(tls *libc.TLS, countp uintptr, stringp uintptr, file uintptr) (r int32) {
  1951. bp := tls.Alloc(16)
  1952. defer tls.Free(16)
  1953. var data uintptr
  1954. var _ /* len at bp+0 */ uint16
  1955. _ = data
  1956. if _read_short(tls, bp, file) == 0 {
  1957. return 0
  1958. }
  1959. if libc.Int32FromUint16(*(*uint16)(unsafe.Pointer(bp))) == 0 {
  1960. data = libc.UintptrFromInt32(0)
  1961. } else {
  1962. data = libc.Xmalloc(tls, uint64(uint32(*(*uint16)(unsafe.Pointer(bp)))))
  1963. if !(data != 0) {
  1964. return 0
  1965. }
  1966. if libc.Xfread(tls, data, uint64(1), uint64(*(*uint16)(unsafe.Pointer(bp))), file) != uint64(*(*uint16)(unsafe.Pointer(bp))) {
  1967. libc.Xexplicit_bzero(tls, data, uint64(*(*uint16)(unsafe.Pointer(bp))))
  1968. libc.Xfree(tls, data)
  1969. return 0
  1970. }
  1971. }
  1972. *(*uintptr)(unsafe.Pointer(stringp)) = data
  1973. *(*uint16)(unsafe.Pointer(countp)) = *(*uint16)(unsafe.Pointer(bp))
  1974. return int32(1)
  1975. }
  1976. func XXauReadAuth(tls *libc.TLS, auth_file uintptr) (r uintptr) {
  1977. bp := tls.Alloc(64)
  1978. defer tls.Free(64)
  1979. var ret uintptr
  1980. var _ /* local at bp+0 */ TXauth
  1981. _ = ret
  1982. *(*TXauth)(unsafe.Pointer(bp)) = TXauth{}
  1983. if _read_short(tls, bp, auth_file) == 0 {
  1984. goto fail
  1985. }
  1986. if _read_counted_string(tls, bp+2, bp+8, auth_file) == 0 {
  1987. goto fail
  1988. }
  1989. if _read_counted_string(tls, bp+16, bp+24, auth_file) == 0 {
  1990. goto fail
  1991. }
  1992. if _read_counted_string(tls, bp+32, bp+40, auth_file) == 0 {
  1993. goto fail
  1994. }
  1995. if _read_counted_string(tls, bp+48, bp+56, auth_file) == 0 {
  1996. goto fail
  1997. }
  1998. ret = libc.Xmalloc(tls, uint64(64))
  1999. if ret == libc.UintptrFromInt32(0) {
  2000. goto fail
  2001. }
  2002. *(*TXauth)(unsafe.Pointer(ret)) = *(*TXauth)(unsafe.Pointer(bp))
  2003. return ret
  2004. goto fail
  2005. fail:
  2006. ;
  2007. libc.Xfree(tls, (*(*TXauth)(unsafe.Pointer(bp))).Faddress)
  2008. libc.Xfree(tls, (*(*TXauth)(unsafe.Pointer(bp))).Fnumber)
  2009. libc.Xfree(tls, (*(*TXauth)(unsafe.Pointer(bp))).Fname)
  2010. if (*(*TXauth)(unsafe.Pointer(bp))).Fdata != 0 {
  2011. libc.Xexplicit_bzero(tls, (*(*TXauth)(unsafe.Pointer(bp))).Fdata, uint64((*(*TXauth)(unsafe.Pointer(bp))).Fdata_length))
  2012. libc.Xfree(tls, (*(*TXauth)(unsafe.Pointer(bp))).Fdata)
  2013. }
  2014. return libc.UintptrFromInt32(0)
  2015. }
  2016. const m_O_CREAT2 = 0x0200
  2017. const m_O_EXCL2 = 0x0800
  2018. const m_O_WRONLY2 = 0x0001
  2019. /*-
  2020. * SPDX-License-Identifier: BSD-3-Clause
  2021. *
  2022. * Copyright (c) 1989, 1993
  2023. * The Regents of the University of California. All rights reserved.
  2024. * (c) UNIX System Laboratories, Inc.
  2025. * All or some portions of this file are derived from material licensed
  2026. * to the University of California by American Telephone and Telegraph
  2027. * Co. or Unix System Laboratories, Inc. and are reproduced herein with
  2028. * the permission of UNIX System Laboratories, Inc.
  2029. *
  2030. * Redistribution and use in source and binary forms, with or without
  2031. * modification, are permitted provided that the following conditions
  2032. * are met:
  2033. * 1. Redistributions of source code must retain the above copyright
  2034. * notice, this list of conditions and the following disclaimer.
  2035. * 2. Redistributions in binary form must reproduce the above copyright
  2036. * notice, this list of conditions and the following disclaimer in the
  2037. * documentation and/or other materials provided with the distribution.
  2038. * 3. Neither the name of the University nor the names of its contributors
  2039. * may be used to endorse or promote products derived from this software
  2040. * without specific prior written permission.
  2041. *
  2042. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  2043. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  2044. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  2045. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  2046. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  2047. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  2048. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  2049. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  2050. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  2051. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  2052. * SUCH DAMAGE.
  2053. *
  2054. * @(#)time.h 8.3 (Berkeley) 1/21/94
  2055. */
  2056. /*
  2057. */
  2058. /* define X_GETTIMEOFDAY macro, a portable gettimeofday() */
  2059. /* use POSIX name for signal */
  2060. /*
  2061. * Copyright 1997 Metro Link Incorporated
  2062. *
  2063. * All Rights Reserved
  2064. *
  2065. * Permission to use, copy, modify, distribute, and sell this software and its
  2066. * documentation for any purpose is hereby granted without fee, provided that
  2067. * the above copyright notice appear in all copies and that both that
  2068. * copyright notice and this permission notice appear in supporting
  2069. * documentation, and that the names of the above listed copyright holder(s)
  2070. * not be used in advertising or publicity pertaining to distribution of
  2071. * the software without specific, written prior permission. The above listed
  2072. * copyright holder(s) make(s) no representations about the suitability of
  2073. * this software for any purpose. It is provided "as is" without express or
  2074. * implied warranty.
  2075. *
  2076. * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD
  2077. * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  2078. * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
  2079. * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
  2080. * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
  2081. * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
  2082. * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  2083. */
  2084. /*
  2085. * Determine the machine's byte order.
  2086. */
  2087. /* See if it is set in the imake config first */
  2088. /*-
  2089. * This file is in the public domain.
  2090. */
  2091. /*-
  2092. * SPDX-License-Identifier: BSD-3-Clause
  2093. *
  2094. * Copyright (c) 1987, 1991 Regents of the University of California.
  2095. * All rights reserved.
  2096. *
  2097. * Redistribution and use in source and binary forms, with or without
  2098. * modification, are permitted provided that the following conditions
  2099. * are met:
  2100. * 1. Redistributions of source code must retain the above copyright
  2101. * notice, this list of conditions and the following disclaimer.
  2102. * 2. Redistributions in binary form must reproduce the above copyright
  2103. * notice, this list of conditions and the following disclaimer in the
  2104. * documentation and/or other materials provided with the distribution.
  2105. * 3. Neither the name of the University nor the names of its contributors
  2106. * may be used to endorse or promote products derived from this software
  2107. * without specific prior written permission.
  2108. *
  2109. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  2110. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  2111. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  2112. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  2113. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  2114. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  2115. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  2116. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  2117. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  2118. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  2119. * SUCH DAMAGE.
  2120. *
  2121. * @(#)endian.h 7.8 (Berkeley) 4/3/91
  2122. */
  2123. func XXauUnlockAuth(tls *libc.TLS, file_name uintptr) (r int32) {
  2124. bp := tls.Alloc(2080)
  2125. defer tls.Free(2080)
  2126. var _ /* creat_name at bp+0 */ [1025]int8
  2127. var _ /* link_name at bp+1025 */ [1025]int8
  2128. if libc.Xstrlen(tls, file_name) > uint64(1022) {
  2129. return 0
  2130. }
  2131. libc.X__builtin_snprintf(tls, bp, uint64(1025), __ccgo_ts+37, libc.VaList(bp+2064, file_name))
  2132. libc.X__builtin_snprintf(tls, bp+1025, uint64(1025), __ccgo_ts+42, libc.VaList(bp+2064, file_name))
  2133. /*
  2134. * I think this is the correct order
  2135. */
  2136. libc.Xremove(tls, bp)
  2137. libc.Xremove(tls, bp+1025)
  2138. return int32(1)
  2139. }
  2140. /* Return values from XauLockAuth */
  2141. func _write_short(tls *libc.TLS, s uint16, file uintptr) (r int32) {
  2142. bp := tls.Alloc(16)
  2143. defer tls.Free(16)
  2144. var _ /* file_short at bp+0 */ [2]uint8
  2145. (*(*[2]uint8)(unsafe.Pointer(bp)))[0] = uint8(uint32(s) & libc.Uint32FromInt32(0xff00) >> int32(8))
  2146. (*(*[2]uint8)(unsafe.Pointer(bp)))[int32(1)] = libc.Uint8FromInt32(libc.Int32FromUint16(s) & int32(0xff))
  2147. if libc.Xfwrite(tls, bp, uint64(2), uint64(1), file) != uint64(1) {
  2148. return 0
  2149. }
  2150. return int32(1)
  2151. }
  2152. func _write_counted_string(tls *libc.TLS, count uint16, string1 uintptr, file uintptr) (r int32) {
  2153. if _write_short(tls, count, file) == 0 {
  2154. return 0
  2155. }
  2156. if libc.Xfwrite(tls, string1, uint64(1), uint64(count), file) != uint64(count) {
  2157. return 0
  2158. }
  2159. return int32(1)
  2160. }
  2161. func XXauWriteAuth(tls *libc.TLS, auth_file uintptr, auth uintptr) (r int32) {
  2162. if _write_short(tls, (*TXauth)(unsafe.Pointer(auth)).Ffamily, auth_file) == 0 {
  2163. return 0
  2164. }
  2165. if _write_counted_string(tls, (*TXauth)(unsafe.Pointer(auth)).Faddress_length, (*TXauth)(unsafe.Pointer(auth)).Faddress, auth_file) == 0 {
  2166. return 0
  2167. }
  2168. if _write_counted_string(tls, (*TXauth)(unsafe.Pointer(auth)).Fnumber_length, (*TXauth)(unsafe.Pointer(auth)).Fnumber, auth_file) == 0 {
  2169. return 0
  2170. }
  2171. if _write_counted_string(tls, (*TXauth)(unsafe.Pointer(auth)).Fname_length, (*TXauth)(unsafe.Pointer(auth)).Fname, auth_file) == 0 {
  2172. return 0
  2173. }
  2174. if _write_counted_string(tls, (*TXauth)(unsafe.Pointer(auth)).Fdata_length, (*TXauth)(unsafe.Pointer(auth)).Fdata, auth_file) == 0 {
  2175. return 0
  2176. }
  2177. return int32(1)
  2178. }
  2179. func __ccgo_fp(f interface{}) uintptr {
  2180. type iface [2]uintptr
  2181. return (*iface)(unsafe.Pointer(&f))[1]
  2182. }
  2183. var __ccgo_ts = (*reflect.StringHeader)(unsafe.Pointer(&__ccgo_ts1)).Data
  2184. var __ccgo_ts1 = "/.Xauthority\x00XAUTHORITY\x00HOME\x00%s%s\x00rb\x00%s-c\x00%s-l\x00"