musl_windows_386.go 31 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118
  1. // Code generated by 'ccgo -D__environ=environ -export-externs X -hide __syscall0,__syscall1,__syscall2,__syscall3,__syscall4,__syscall5,__syscall6 -nostdinc -nostdlib -o ../musl_windows_386.go -pkgname libc -static-locals-prefix _s -Iarch/i386 -Iarch/generic -Iobj/src/internal -Isrc/include -Isrc/internal -Iobj/include -Iinclude copyright.c src/ctype/isalnum.c src/ctype/isalpha.c src/ctype/isdigit.c src/ctype/islower.c src/ctype/isprint.c src/ctype/isspace.c src/ctype/isxdigit.c src/env/putenv.c src/env/setenv.c src/env/unsetenv.c src/multibyte/wcrtomb.c src/multibyte/wcsrtombs.c src/multibyte/wcstombs.c src/string/strchrnul.c src/string/strdup.c', DO NOT EDIT.
  2. package libc
  3. import (
  4. "math"
  5. "reflect"
  6. "sync/atomic"
  7. "unsafe"
  8. )
  9. var _ = math.Pi
  10. var _ reflect.Kind
  11. var _ atomic.Value
  12. var _ unsafe.Pointer
  13. // musl as a whole is licensed under the following standard MIT license:
  14. //
  15. // ----------------------------------------------------------------------
  16. // Copyright © 2005-2020 Rich Felker, et al.
  17. //
  18. // Permission is hereby granted, free of charge, to any person obtaining
  19. // a copy of this software and associated documentation files (the
  20. // "Software"), to deal in the Software without restriction, including
  21. // without limitation the rights to use, copy, modify, merge, publish,
  22. // distribute, sublicense, and/or sell copies of the Software, and to
  23. // permit persons to whom the Software is furnished to do so, subject to
  24. // the following conditions:
  25. //
  26. // The above copyright notice and this permission notice shall be
  27. // included in all copies or substantial portions of the Software.
  28. //
  29. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  30. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  31. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  32. // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  33. // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  34. // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  35. // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  36. // ----------------------------------------------------------------------
  37. //
  38. // Authors/contributors include:
  39. //
  40. // A. Wilcox
  41. // Ada Worcester
  42. // Alex Dowad
  43. // Alex Suykov
  44. // Alexander Monakov
  45. // Andre McCurdy
  46. // Andrew Kelley
  47. // Anthony G. Basile
  48. // Aric Belsito
  49. // Arvid Picciani
  50. // Bartosz Brachaczek
  51. // Benjamin Peterson
  52. // Bobby Bingham
  53. // Boris Brezillon
  54. // Brent Cook
  55. // Chris Spiegel
  56. // Clément Vasseur
  57. // Daniel Micay
  58. // Daniel Sabogal
  59. // Daurnimator
  60. // David Carlier
  61. // David Edelsohn
  62. // Denys Vlasenko
  63. // Dmitry Ivanov
  64. // Dmitry V. Levin
  65. // Drew DeVault
  66. // Emil Renner Berthing
  67. // Fangrui Song
  68. // Felix Fietkau
  69. // Felix Janda
  70. // Gianluca Anzolin
  71. // Hauke Mehrtens
  72. // He X
  73. // Hiltjo Posthuma
  74. // Isaac Dunham
  75. // Jaydeep Patil
  76. // Jens Gustedt
  77. // Jeremy Huntwork
  78. // Jo-Philipp Wich
  79. // Joakim Sindholt
  80. // John Spencer
  81. // Julien Ramseier
  82. // Justin Cormack
  83. // Kaarle Ritvanen
  84. // Khem Raj
  85. // Kylie McClain
  86. // Leah Neukirchen
  87. // Luca Barbato
  88. // Luka Perkov
  89. // M Farkas-Dyck (Strake)
  90. // Mahesh Bodapati
  91. // Markus Wichmann
  92. // Masanori Ogino
  93. // Michael Clark
  94. // Michael Forney
  95. // Mikhail Kremnyov
  96. // Natanael Copa
  97. // Nicholas J. Kain
  98. // orc
  99. // Pascal Cuoq
  100. // Patrick Oppenlander
  101. // Petr Hosek
  102. // Petr Skocik
  103. // Pierre Carrier
  104. // Reini Urban
  105. // Rich Felker
  106. // Richard Pennington
  107. // Ryan Fairfax
  108. // Samuel Holland
  109. // Segev Finer
  110. // Shiz
  111. // sin
  112. // Solar Designer
  113. // Stefan Kristiansson
  114. // Stefan O'Rear
  115. // Szabolcs Nagy
  116. // Timo Teräs
  117. // Trutz Behn
  118. // Valentin Ochs
  119. // Will Dietz
  120. // William Haddon
  121. // William Pitcock
  122. //
  123. // Portions of this software are derived from third-party works licensed
  124. // under terms compatible with the above MIT license:
  125. //
  126. // The TRE regular expression implementation (src/regex/reg* and
  127. // src/regex/tre*) is Copyright © 2001-2008 Ville Laurikari and licensed
  128. // under a 2-clause BSD license (license text in the source files). The
  129. // included version has been heavily modified by Rich Felker in 2012, in
  130. // the interests of size, simplicity, and namespace cleanliness.
  131. //
  132. // Much of the math library code (src/math/* and src/complex/*) is
  133. // Copyright © 1993,2004 Sun Microsystems or
  134. // Copyright © 2003-2011 David Schultz or
  135. // Copyright © 2003-2009 Steven G. Kargl or
  136. // Copyright © 2003-2009 Bruce D. Evans or
  137. // Copyright © 2008 Stephen L. Moshier or
  138. // Copyright © 2017-2018 Arm Limited
  139. // and labelled as such in comments in the individual source files. All
  140. // have been licensed under extremely permissive terms.
  141. //
  142. // The ARM memcpy code (src/string/arm/memcpy.S) is Copyright © 2008
  143. // The Android Open Source Project and is licensed under a two-clause BSD
  144. // license. It was taken from Bionic libc, used on Android.
  145. //
  146. // The AArch64 memcpy and memset code (src/string/aarch64/*) are
  147. // Copyright © 1999-2019, Arm Limited.
  148. //
  149. // The implementation of DES for crypt (src/crypt/crypt_des.c) is
  150. // Copyright © 1994 David Burren. It is licensed under a BSD license.
  151. //
  152. // The implementation of blowfish crypt (src/crypt/crypt_blowfish.c) was
  153. // originally written by Solar Designer and placed into the public
  154. // domain. The code also comes with a fallback permissive license for use
  155. // in jurisdictions that may not recognize the public domain.
  156. //
  157. // The smoothsort implementation (src/stdlib/qsort.c) is Copyright © 2011
  158. // Valentin Ochs and is licensed under an MIT-style license.
  159. //
  160. // The x86_64 port was written by Nicholas J. Kain and is licensed under
  161. // the standard MIT terms.
  162. //
  163. // The mips and microblaze ports were originally written by Richard
  164. // Pennington for use in the ellcc project. The original code was adapted
  165. // by Rich Felker for build system and code conventions during upstream
  166. // integration. It is licensed under the standard MIT terms.
  167. //
  168. // The mips64 port was contributed by Imagination Technologies and is
  169. // licensed under the standard MIT terms.
  170. //
  171. // The powerpc port was also originally written by Richard Pennington,
  172. // and later supplemented and integrated by John Spencer. It is licensed
  173. // under the standard MIT terms.
  174. //
  175. // All other files which have no copyright comments are original works
  176. // produced specifically for use as part of this library, written either
  177. // by Rich Felker, the main author of the library, or by one or more
  178. // contibutors listed above. Details on authorship of individual files
  179. // can be found in the git version control history of the project. The
  180. // omission of copyright and license comments in each file is in the
  181. // interest of source tree size.
  182. //
  183. // In addition, permission is hereby granted for all public header files
  184. // (include/* and arch/*/bits/*) and crt files intended to be linked into
  185. // applications (crt/*, ldso/dlstart.c, and arch/*/crt_arch.h) to omit
  186. // the copyright notice and permission notice otherwise required by the
  187. // license, and to use these files without any requirement of
  188. // attribution. These files include substantial contributions from:
  189. //
  190. // Bobby Bingham
  191. // John Spencer
  192. // Nicholas J. Kain
  193. // Rich Felker
  194. // Richard Pennington
  195. // Stefan Kristiansson
  196. // Szabolcs Nagy
  197. //
  198. // all of whom have explicitly granted such permission.
  199. //
  200. // This file previously contained text expressing a belief that most of
  201. // the files covered by the above exception were sufficiently trivial not
  202. // to be subject to copyright, resulting in confusion over whether it
  203. // negated the permissions granted in the license. In the spirit of
  204. // permissive licensing, and of not having licensing issues being an
  205. // obstacle to adoption, that text has been removed.
  206. const ( /* copyright.c:194:1: */
  207. __musl__copyright__ = 0
  208. )
  209. const ( /* pthread_impl.h:58:1: */
  210. DT_EXITING = 0
  211. DT_JOINABLE = 1
  212. DT_DETACHED = 2
  213. )
  214. type ptrdiff_t = int32 /* <builtin>:3:26 */
  215. type size_t = uint32 /* <builtin>:9:23 */
  216. type wchar_t = uint16 /* <builtin>:15:24 */
  217. type va_list = uintptr /* <builtin>:50:27 */
  218. type __locale_struct = struct{ cat [6]uintptr } /* alltypes.h:366:9 */
  219. type locale_t = uintptr /* alltypes.h:366:32 */
  220. func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */
  221. if __ccgo_strace {
  222. trc("tls=%v c=%v, (%v:)", tls, c, origin(2))
  223. }
  224. return Bool32(func() int32 {
  225. if 0 != 0 {
  226. return Xisalpha(tls, c)
  227. }
  228. return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26))
  229. }() != 0 || func() int32 {
  230. if 0 != 0 {
  231. return Xisdigit(tls, c)
  232. }
  233. return Bool32(uint32(c)-uint32('0') < uint32(10))
  234. }() != 0)
  235. }
  236. func X__isalnum_l(tls *TLS, c int32, l locale_t) int32 { /* isalnum.c:8:5: */
  237. if __ccgo_strace {
  238. trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2))
  239. }
  240. return Xisalnum(tls, c)
  241. }
  242. func Xisalpha(tls *TLS, c int32) int32 { /* isalpha.c:4:5: */
  243. if __ccgo_strace {
  244. trc("tls=%v c=%v, (%v:)", tls, c, origin(2))
  245. }
  246. return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26))
  247. }
  248. func X__isalpha_l(tls *TLS, c int32, l locale_t) int32 { /* isalpha.c:9:5: */
  249. if __ccgo_strace {
  250. trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2))
  251. }
  252. return Xisalpha(tls, c)
  253. }
  254. func Xisdigit(tls *TLS, c int32) int32 { /* isdigit.c:4:5: */
  255. if __ccgo_strace {
  256. trc("tls=%v c=%v, (%v:)", tls, c, origin(2))
  257. }
  258. return Bool32(uint32(c)-uint32('0') < uint32(10))
  259. }
  260. func X__isdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isdigit.c:9:5: */
  261. if __ccgo_strace {
  262. trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2))
  263. }
  264. return Xisdigit(tls, c)
  265. }
  266. func X__islower_l(tls *TLS, c int32, l locale_t) int32 { /* islower.c:9:5: */
  267. if __ccgo_strace {
  268. trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2))
  269. }
  270. return Xislower(tls, c)
  271. }
  272. func Xisprint(tls *TLS, c int32) int32 { /* isprint.c:4:5: */
  273. if __ccgo_strace {
  274. trc("tls=%v c=%v, (%v:)", tls, c, origin(2))
  275. }
  276. return Bool32(uint32(c)-uint32(0x20) < uint32(0x5f))
  277. }
  278. func X__isprint_l(tls *TLS, c int32, l locale_t) int32 { /* isprint.c:9:5: */
  279. if __ccgo_strace {
  280. trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2))
  281. }
  282. return Xisprint(tls, c)
  283. }
  284. func Xisspace(tls *TLS, c int32) int32 { /* isspace.c:4:5: */
  285. if __ccgo_strace {
  286. trc("tls=%v c=%v, (%v:)", tls, c, origin(2))
  287. }
  288. return Bool32(c == ' ' || uint32(c)-uint32('\t') < uint32(5))
  289. }
  290. func X__isspace_l(tls *TLS, c int32, l locale_t) int32 { /* isspace.c:9:5: */
  291. if __ccgo_strace {
  292. trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2))
  293. }
  294. return Xisspace(tls, c)
  295. }
  296. func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */
  297. if __ccgo_strace {
  298. trc("tls=%v c=%v, (%v:)", tls, c, origin(2))
  299. }
  300. return Bool32(func() int32 {
  301. if 0 != 0 {
  302. return Xisdigit(tls, c)
  303. }
  304. return Bool32(uint32(c)-uint32('0') < uint32(10))
  305. }() != 0 || uint32(c)|uint32(32)-uint32('a') < uint32(6))
  306. }
  307. func X__isxdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isxdigit.c:8:5: */
  308. if __ccgo_strace {
  309. trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2))
  310. }
  311. return Xisxdigit(tls, c)
  312. }
  313. type div_t = struct {
  314. quot int32
  315. rem int32
  316. } /* stdlib.h:62:35 */
  317. type ldiv_t = struct {
  318. quot int32
  319. rem int32
  320. } /* stdlib.h:63:36 */
  321. type lldiv_t = struct {
  322. quot int64
  323. rem int64
  324. } /* stdlib.h:64:41 */
  325. type ssize_t = int32 /* alltypes.h:88:15 */
  326. type intptr_t = int32 /* alltypes.h:93:15 */
  327. type off_t = int64 /* alltypes.h:185:16 */
  328. type pid_t = int32 /* alltypes.h:258:13 */
  329. type uid_t = uint32 /* alltypes.h:268:18 */
  330. type gid_t = uint32 /* alltypes.h:273:18 */
  331. type useconds_t = uint32 /* alltypes.h:283:18 */
  332. func X__putenv(tls *TLS, s uintptr, l size_t, r uintptr) int32 { /* putenv.c:8:5: */
  333. if __ccgo_strace {
  334. trc("tls=%v s=%v l=%v r=%v, (%v:)", tls, s, l, r, origin(2))
  335. }
  336. var i size_t
  337. var newenv uintptr
  338. var tmp uintptr
  339. //TODO for (char **e = __environ; *e; e++, i++)
  340. var e uintptr
  341. i = size_t(0)
  342. if !(Environ() != 0) {
  343. goto __1
  344. }
  345. //TODO for (char **e = __environ; *e; e++, i++)
  346. e = Environ()
  347. __2:
  348. if !(*(*uintptr)(unsafe.Pointer(e)) != 0) {
  349. goto __4
  350. }
  351. if !!(Xstrncmp(tls, s, *(*uintptr)(unsafe.Pointer(e)), l+size_t(1)) != 0) {
  352. goto __5
  353. }
  354. tmp = *(*uintptr)(unsafe.Pointer(e))
  355. *(*uintptr)(unsafe.Pointer(e)) = s
  356. X__env_rm_add(tls, tmp, r)
  357. return 0
  358. __5:
  359. ;
  360. goto __3
  361. __3:
  362. e += 4
  363. i++
  364. goto __2
  365. goto __4
  366. __4:
  367. ;
  368. __1:
  369. ;
  370. if !(Environ() == _soldenv) {
  371. goto __6
  372. }
  373. newenv = Xrealloc(tls, _soldenv, uint32(unsafe.Sizeof(uintptr(0)))*(i+size_t(2)))
  374. if !!(newenv != 0) {
  375. goto __8
  376. }
  377. goto oom
  378. __8:
  379. ;
  380. goto __7
  381. __6:
  382. newenv = Xmalloc(tls, uint32(unsafe.Sizeof(uintptr(0)))*(i+size_t(2)))
  383. if !!(newenv != 0) {
  384. goto __9
  385. }
  386. goto oom
  387. __9:
  388. ;
  389. if !(i != 0) {
  390. goto __10
  391. }
  392. Xmemcpy(tls, newenv, Environ(), uint32(unsafe.Sizeof(uintptr(0)))*i)
  393. __10:
  394. ;
  395. Xfree(tls, _soldenv)
  396. __7:
  397. ;
  398. *(*uintptr)(unsafe.Pointer(newenv + uintptr(i)*4)) = s
  399. *(*uintptr)(unsafe.Pointer(newenv + uintptr(i+size_t(1))*4)) = uintptr(0)
  400. *(*uintptr)(unsafe.Pointer(EnvironP())) = AssignPtrUintptr(uintptr(unsafe.Pointer(&_soldenv)), newenv)
  401. if !(r != 0) {
  402. goto __11
  403. }
  404. X__env_rm_add(tls, uintptr(0), r)
  405. __11:
  406. ;
  407. return 0
  408. oom:
  409. Xfree(tls, r)
  410. return -1
  411. }
  412. var _soldenv uintptr /* putenv.c:22:14: */
  413. func Xputenv(tls *TLS, s uintptr) int32 { /* putenv.c:43:5: */
  414. if __ccgo_strace {
  415. trc("tls=%v s=%v, (%v:)", tls, s, origin(2))
  416. }
  417. var l size_t = size_t((int32(X__strchrnul(tls, s, '=')) - int32(s)) / 1)
  418. if !(l != 0) || !(int32(*(*int8)(unsafe.Pointer(s + uintptr(l)))) != 0) {
  419. return Xunsetenv(tls, s)
  420. }
  421. return X__putenv(tls, s, l, uintptr(0))
  422. }
  423. func X__env_rm_add(tls *TLS, old uintptr, new uintptr) { /* setenv.c:5:6: */
  424. if __ccgo_strace {
  425. trc("tls=%v old=%v new=%v, (%v:)", tls, old, new, origin(2))
  426. }
  427. //TODO for (size_t i=0; i < env_alloced_n; i++)
  428. var i size_t = size_t(0)
  429. for ; i < _senv_alloced_n; i++ {
  430. if *(*uintptr)(unsafe.Pointer(_senv_alloced + uintptr(i)*4)) == old {
  431. *(*uintptr)(unsafe.Pointer(_senv_alloced + uintptr(i)*4)) = new
  432. Xfree(tls, old)
  433. return
  434. } else if !(int32(*(*uintptr)(unsafe.Pointer(_senv_alloced + uintptr(i)*4))) != 0) && new != 0 {
  435. *(*uintptr)(unsafe.Pointer(_senv_alloced + uintptr(i)*4)) = new
  436. new = uintptr(0)
  437. }
  438. }
  439. if !(new != 0) {
  440. return
  441. }
  442. var t uintptr = Xrealloc(tls, _senv_alloced, uint32(unsafe.Sizeof(uintptr(0)))*(_senv_alloced_n+size_t(1)))
  443. if !(t != 0) {
  444. return
  445. }
  446. *(*uintptr)(unsafe.Pointer(AssignPtrUintptr(uintptr(unsafe.Pointer(&_senv_alloced)), t) + uintptr(PostIncUint32(&_senv_alloced_n, 1))*4)) = new
  447. }
  448. var _senv_alloced uintptr /* setenv.c:7:14: */
  449. var _senv_alloced_n size_t /* setenv.c:8:16: */
  450. func Xsetenv(tls *TLS, var1 uintptr, value uintptr, overwrite int32) int32 { /* setenv.c:26:5: */
  451. if __ccgo_strace {
  452. trc("tls=%v var1=%v value=%v overwrite=%v, (%v:)", tls, var1, value, overwrite, origin(2))
  453. }
  454. var s uintptr
  455. var l1 size_t
  456. var l2 size_t
  457. if !(var1 != 0) || !(int32(AssignUint32(&l1, size_t((int32(X__strchrnul(tls, var1, '='))-int32(var1))/1))) != 0) || *(*int8)(unsafe.Pointer(var1 + uintptr(l1))) != 0 {
  458. *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 22
  459. return -1
  460. }
  461. if !(overwrite != 0) && Xgetenv(tls, var1) != 0 {
  462. return 0
  463. }
  464. l2 = Xstrlen(tls, value)
  465. s = Xmalloc(tls, l1+l2+size_t(2))
  466. if !(s != 0) {
  467. return -1
  468. }
  469. Xmemcpy(tls, s, var1, l1)
  470. *(*int8)(unsafe.Pointer(s + uintptr(l1))) = int8('=')
  471. Xmemcpy(tls, s+uintptr(l1)+uintptr(1), value, l2+size_t(1))
  472. return X__putenv(tls, s, l1, s)
  473. }
  474. func Xunsetenv(tls *TLS, name uintptr) int32 { /* unsetenv.c:9:5: */
  475. if __ccgo_strace {
  476. trc("tls=%v name=%v, (%v:)", tls, name, origin(2))
  477. }
  478. var l size_t = size_t((int32(X__strchrnul(tls, name, '=')) - int32(name)) / 1)
  479. if !(l != 0) || *(*int8)(unsafe.Pointer(name + uintptr(l))) != 0 {
  480. *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 22
  481. return -1
  482. }
  483. if Environ() != 0 {
  484. var e uintptr = Environ()
  485. var eo uintptr = e
  486. for ; *(*uintptr)(unsafe.Pointer(e)) != 0; e += 4 {
  487. //TODO if (!strncmp(name, *e, l) && l[*e] == '=')
  488. if !(Xstrncmp(tls, name, *(*uintptr)(unsafe.Pointer(e)), l) != 0) && int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(e)) + uintptr(l)))) == '=' {
  489. X__env_rm_add(tls, *(*uintptr)(unsafe.Pointer(e)), uintptr(0))
  490. } else if eo != e {
  491. *(*uintptr)(unsafe.Pointer(PostIncUintptr(&eo, 4))) = *(*uintptr)(unsafe.Pointer(e))
  492. } else {
  493. eo += 4
  494. }
  495. }
  496. if eo != e {
  497. *(*uintptr)(unsafe.Pointer(eo)) = uintptr(0)
  498. }
  499. }
  500. return 0
  501. }
  502. type wint_t = uint32 /* alltypes.h:221:18 */
  503. type wctype_t = uint32 /* alltypes.h:226:23 */
  504. type __mbstate_t = struct {
  505. __opaque1 uint32
  506. __opaque2 uint32
  507. } /* alltypes.h:360:9 */
  508. type mbstate_t = __mbstate_t /* alltypes.h:360:63 */
  509. type tm = struct {
  510. tm_sec int32
  511. tm_min int32
  512. tm_hour int32
  513. tm_mday int32
  514. tm_mon int32
  515. tm_year int32
  516. tm_wday int32
  517. tm_yday int32
  518. tm_isdst int32
  519. tm_gmtoff int32
  520. tm_zone uintptr
  521. } /* wchar.h:138:1 */
  522. type uintptr_t = uint32 /* alltypes.h:78:24 */
  523. type int8_t = int8 /* alltypes.h:119:25 */
  524. type int16_t = int16 /* alltypes.h:124:25 */
  525. type int32_t = int32 /* alltypes.h:129:25 */
  526. type int64_t = int64 /* alltypes.h:134:25 */
  527. type intmax_t = int64 /* alltypes.h:139:25 */
  528. type uint8_t = uint8 /* alltypes.h:144:25 */
  529. type uint16_t = uint16 /* alltypes.h:149:25 */
  530. type uint32_t = uint32 /* alltypes.h:154:25 */
  531. type uint64_t = uint64 /* alltypes.h:159:25 */
  532. type uintmax_t = uint64 /* alltypes.h:169:25 */
  533. type int_fast8_t = int8_t /* stdint.h:22:16 */
  534. type int_fast64_t = int64_t /* stdint.h:23:17 */
  535. type int_least8_t = int8_t /* stdint.h:25:17 */
  536. type int_least16_t = int16_t /* stdint.h:26:17 */
  537. type int_least32_t = int32_t /* stdint.h:27:17 */
  538. type int_least64_t = int64_t /* stdint.h:28:17 */
  539. type uint_fast8_t = uint8_t /* stdint.h:30:17 */
  540. type uint_fast64_t = uint64_t /* stdint.h:31:18 */
  541. type uint_least8_t = uint8_t /* stdint.h:33:18 */
  542. type uint_least16_t = uint16_t /* stdint.h:34:18 */
  543. type uint_least32_t = uint32_t /* stdint.h:35:18 */
  544. type uint_least64_t = uint64_t /* stdint.h:36:18 */
  545. type int_fast16_t = int32_t /* stdint.h:1:17 */
  546. type int_fast32_t = int32_t /* stdint.h:2:17 */
  547. type uint_fast16_t = uint32_t /* stdint.h:3:18 */
  548. type uint_fast32_t = uint32_t /* stdint.h:4:18 */
  549. // Upper 6 state bits are a negative integer offset to bound-check next byte
  550. // equivalent to: ( (b-0x80) | (b+offset) ) & ~0x3f
  551. // Interval [a,b). Either a must be 80 or b must be c0, lower 3 bits clear.
  552. // Arbitrary encoding for representing code units instead of characters.
  553. // Get inline definition of MB_CUR_MAX.
  554. type lconv = struct {
  555. decimal_point uintptr
  556. thousands_sep uintptr
  557. grouping uintptr
  558. int_curr_symbol uintptr
  559. currency_symbol uintptr
  560. mon_decimal_point uintptr
  561. mon_thousands_sep uintptr
  562. mon_grouping uintptr
  563. positive_sign uintptr
  564. negative_sign uintptr
  565. int_frac_digits int8
  566. frac_digits int8
  567. p_cs_precedes int8
  568. p_sep_by_space int8
  569. n_cs_precedes int8
  570. n_sep_by_space int8
  571. p_sign_posn int8
  572. n_sign_posn int8
  573. int_p_cs_precedes int8
  574. int_p_sep_by_space int8
  575. int_n_cs_precedes int8
  576. int_n_sep_by_space int8
  577. int_p_sign_posn int8
  578. int_n_sign_posn int8
  579. _ [2]byte
  580. } /* locale.h:24:1 */
  581. type _G_fpos64_t = struct {
  582. _ [0]uint64
  583. __opaque [16]int8
  584. } /* stdio.h:54:9 */
  585. type fpos_t = _G_fpos64_t /* stdio.h:58:3 */
  586. // Support signed or unsigned plain-char
  587. // Implementation choices...
  588. // Arbitrary numbers...
  589. // POSIX/SUS requirements follow. These numbers come directly
  590. // from SUS and have nothing to do with the host system.
  591. type __locale_map = struct {
  592. __map uintptr
  593. map_size size_t
  594. name [24]int8
  595. next uintptr
  596. } /* alltypes.h:366:9 */
  597. type tls_module = struct {
  598. next uintptr
  599. image uintptr
  600. len size_t
  601. size size_t
  602. align size_t
  603. offset size_t
  604. } /* libc.h:14:1 */
  605. type __libc = struct {
  606. can_do_threads int8
  607. threaded int8
  608. secure int8
  609. need_locks int8
  610. threads_minus_1 int32
  611. auxv uintptr
  612. tls_head uintptr
  613. tls_size size_t
  614. tls_align size_t
  615. tls_cnt size_t
  616. page_size size_t
  617. global_locale struct{ cat [6]uintptr }
  618. } /* libc.h:20:1 */
  619. type time_t = int64 /* alltypes.h:108:16 */
  620. type clockid_t = int32 /* alltypes.h:237:13 */
  621. type timespec = struct {
  622. tv_sec time_t
  623. tv_nsec int32
  624. __12 uint32 /* int : 32 */
  625. } /* alltypes.h:252:1 */
  626. type __pthread = struct {
  627. self uintptr
  628. dtv uintptr
  629. prev uintptr
  630. next uintptr
  631. sysinfo uintptr_t
  632. canary uintptr_t
  633. canary2 uintptr_t
  634. tid int32
  635. errno_val int32
  636. detach_state int32
  637. cancel int32
  638. canceldisable uint8
  639. cancelasync uint8
  640. tsd_used uint8 /* unsigned char tsd_used: 1, unsigned char dlerror_flag: 1 */
  641. _ [1]byte
  642. map_base uintptr
  643. map_size size_t
  644. stack uintptr
  645. stack_size size_t
  646. guard_size size_t
  647. result uintptr
  648. cancelbuf uintptr
  649. tsd uintptr
  650. robust_list struct {
  651. head uintptr
  652. off int32
  653. pending uintptr
  654. }
  655. timer_id int32
  656. locale locale_t
  657. killlock [1]int32
  658. dlerror_buf uintptr
  659. stdio_locks uintptr
  660. canary_at_end uintptr_t
  661. dtv_copy uintptr
  662. } /* alltypes.h:296:9 */
  663. type pthread_t = uintptr /* alltypes.h:296:26 */
  664. type pthread_once_t = int32 /* alltypes.h:302:13 */
  665. type pthread_key_t = uint32 /* alltypes.h:307:18 */
  666. type pthread_spinlock_t = int32 /* alltypes.h:312:13 */
  667. type pthread_mutexattr_t = struct{ __attr uint32 } /* alltypes.h:317:37 */
  668. type pthread_condattr_t = struct{ __attr uint32 } /* alltypes.h:322:37 */
  669. type pthread_barrierattr_t = struct{ __attr uint32 } /* alltypes.h:327:37 */
  670. type pthread_rwlockattr_t = struct{ __attr [2]uint32 } /* alltypes.h:332:40 */
  671. type __sigset_t = struct{ __bits [32]uint32 } /* alltypes.h:372:9 */
  672. type sigset_t = __sigset_t /* alltypes.h:372:71 */
  673. type pthread_attr_t = struct{ __u struct{ __i [9]int32 } } /* alltypes.h:395:147 */
  674. type pthread_mutex_t = struct{ __u struct{ __i [6]int32 } } /* alltypes.h:400:157 */
  675. type pthread_cond_t = struct{ __u struct{ __i [12]int32 } } /* alltypes.h:410:112 */
  676. type pthread_rwlock_t = struct{ __u struct{ __i [8]int32 } } /* alltypes.h:420:139 */
  677. type pthread_barrier_t = struct{ __u struct{ __i [5]int32 } } /* alltypes.h:425:137 */
  678. type sched_param = struct {
  679. sched_priority int32
  680. __reserved1 int32
  681. __reserved2 [4]int32
  682. __reserved3 int32
  683. } /* sched.h:19:1 */
  684. type timer_t = uintptr /* alltypes.h:232:14 */
  685. type clock_t = int32 /* alltypes.h:242:14 */
  686. type itimerspec = struct {
  687. it_interval struct {
  688. tv_sec time_t
  689. tv_nsec int32
  690. __12 uint32 /* int : 32 */
  691. }
  692. it_value struct {
  693. tv_sec time_t
  694. tv_nsec int32
  695. __12 uint32 /* int : 32 */
  696. }
  697. } /* time.h:80:1 */
  698. type sigevent = struct {
  699. sigev_value struct{ sival_int int32 }
  700. sigev_signo int32
  701. sigev_notify int32
  702. sigev_notify_function uintptr
  703. sigev_notify_attributes uintptr
  704. __pad [44]int8
  705. } /* time.h:107:1 */
  706. type __ptcb = struct {
  707. __f uintptr
  708. __x uintptr
  709. __next uintptr
  710. } /* alltypes.h:296:9 */
  711. type sigaltstack = struct {
  712. ss_sp uintptr
  713. ss_flags int32
  714. ss_size size_t
  715. } /* signal.h:44:9 */
  716. type stack_t = sigaltstack /* signal.h:44:28 */
  717. type greg_t = int32 /* signal.h:51:13 */
  718. type gregset_t = [19]int32 /* signal.h:51:21 */
  719. type _fpstate = struct {
  720. cw uint32
  721. sw uint32
  722. tag uint32
  723. ipoff uint32
  724. cssel uint32
  725. dataoff uint32
  726. datasel uint32
  727. _st [8]struct {
  728. significand [4]uint16
  729. exponent uint16
  730. }
  731. status uint32
  732. } /* signal.h:52:9 */
  733. type fpregset_t = uintptr /* signal.h:58:3 */
  734. type sigcontext = struct {
  735. gs uint16
  736. __gsh uint16
  737. fs uint16
  738. __fsh uint16
  739. es uint16
  740. __esh uint16
  741. ds uint16
  742. __dsh uint16
  743. edi uint32
  744. esi uint32
  745. ebp uint32
  746. esp uint32
  747. ebx uint32
  748. edx uint32
  749. ecx uint32
  750. eax uint32
  751. trapno uint32
  752. err uint32
  753. eip uint32
  754. cs uint16
  755. __csh uint16
  756. eflags uint32
  757. esp_at_signal uint32
  758. ss uint16
  759. __ssh uint16
  760. fpstate uintptr
  761. oldmask uint32
  762. cr2 uint32
  763. } /* signal.h:59:1 */
  764. type mcontext_t = struct {
  765. gregs gregset_t
  766. fpregs fpregset_t
  767. oldmask uint32
  768. cr2 uint32
  769. } /* signal.h:73:3 */
  770. type __ucontext = struct {
  771. uc_flags uint32
  772. uc_link uintptr
  773. uc_stack stack_t
  774. uc_mcontext mcontext_t
  775. uc_sigmask sigset_t
  776. __fpregs_mem [28]uint32
  777. } /* signal.h:86:9 */
  778. type ucontext_t = __ucontext /* signal.h:93:3 */
  779. type sigval = struct{ sival_int int32 } /* time.h:107:1 */
  780. type siginfo_t = struct {
  781. si_signo int32
  782. si_errno int32
  783. si_code int32
  784. __si_fields struct {
  785. _ [0]uint32
  786. __pad [116]int8
  787. }
  788. } /* signal.h:145:3 */
  789. type sigaction = struct {
  790. __sa_handler struct{ sa_handler uintptr }
  791. sa_mask sigset_t
  792. sa_flags int32
  793. sa_restorer uintptr
  794. } /* signal.h:167:1 */
  795. type sig_t = uintptr /* signal.h:251:14 */
  796. type sig_atomic_t = int32 /* signal.h:269:13 */
  797. type mode_t = uint32 /* alltypes.h:175:18 */
  798. type syscall_arg_t = int32 /* syscall.h:22:14 */
  799. func a_and(tls *TLS, p uintptr, v int32) { /* atomic_arch.h:29:20: */
  800. panic(`arch/i386/atomic_arch.h:31:2: assembler statements not supported`)
  801. }
  802. func a_ctz_64(tls *TLS, x uint64_t) int32 { /* atomic_arch.h:87:19: */
  803. var r int32
  804. panic(`arch/i386/atomic_arch.h:90:2: assembler statements not supported`)
  805. return r
  806. }
  807. func a_ctz_32(tls *TLS, x uint32_t) int32 { /* atomic_arch.h:96:19: */
  808. var r int32
  809. panic(`arch/i386/atomic_arch.h:99:2: assembler statements not supported`)
  810. return r
  811. }
  812. func a_clz_32(tls *TLS, x uint32_t) int32 { /* atomic_arch.h:104:19: */
  813. panic(`arch/i386/atomic_arch.h:106:2: assembler statements not supported`)
  814. return int32(x)
  815. }
  816. type a_cas_p_undefined_but_pointer_not_32bit = [1]int8 /* atomic.h:229:14 */
  817. type __timer = struct {
  818. timerid int32
  819. thread pthread_t
  820. } /* pthread_impl.h:64:1 */
  821. func __pthread_self(tls *TLS) uintptr { /* pthread_arch.h:1:30: */
  822. var self uintptr
  823. panic(`arch/i386/pthread_arch.h:4:2: assembler statements not supported`)
  824. return self
  825. }
  826. func Xwcrtomb(tls *TLS, s uintptr, wc wchar_t, st uintptr) size_t { /* wcrtomb.c:6:8: */
  827. if __ccgo_strace {
  828. trc("tls=%v s=%v wc=%v st=%v, (%v:)", tls, s, wc, st, origin(2))
  829. }
  830. if !(s != 0) {
  831. return size_t(1)
  832. }
  833. if uint32(wc) < uint32(0x80) {
  834. *(*int8)(unsafe.Pointer(s)) = int8(wc)
  835. return size_t(1)
  836. } else if func() int32 {
  837. if !!(int32(*(*uintptr)(unsafe.Pointer((*__pthread)(unsafe.Pointer(__pthread_self(tls))).locale))) != 0) {
  838. return 4
  839. }
  840. return 1
  841. }() == 1 {
  842. if !(uint32(wc)-uint32(0xdf80) < uint32(0x80)) {
  843. *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 84
  844. return Uint32FromInt32(-1)
  845. }
  846. *(*int8)(unsafe.Pointer(s)) = int8(wc)
  847. return size_t(1)
  848. } else if uint32(wc) < uint32(0x800) {
  849. *(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = int8(0xc0 | int32(wc)>>6)
  850. *(*int8)(unsafe.Pointer(s)) = int8(0x80 | int32(wc)&0x3f)
  851. return size_t(2)
  852. } else if uint32(wc) < uint32(0xd800) || uint32(wc)-uint32(0xe000) < uint32(0x2000) {
  853. *(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = int8(0xe0 | int32(wc)>>12)
  854. *(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = int8(0x80 | int32(wc)>>6&0x3f)
  855. *(*int8)(unsafe.Pointer(s)) = int8(0x80 | int32(wc)&0x3f)
  856. return size_t(3)
  857. } else if uint32(wc)-uint32(0x10000) < uint32(0x100000) {
  858. *(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = int8(0xf0 | int32(wc)>>18)
  859. *(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = int8(0x80 | int32(wc)>>12&0x3f)
  860. *(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = int8(0x80 | int32(wc)>>6&0x3f)
  861. *(*int8)(unsafe.Pointer(s)) = int8(0x80 | int32(wc)&0x3f)
  862. return size_t(4)
  863. }
  864. *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 84
  865. return Uint32FromInt32(-1)
  866. }
  867. func Xwcsrtombs(tls *TLS, s uintptr, ws uintptr, n size_t, st uintptr) size_t { /* wcsrtombs.c:3:8: */
  868. if __ccgo_strace {
  869. trc("tls=%v s=%v ws=%v n=%v st=%v, (%v:)", tls, s, ws, n, st, origin(2))
  870. }
  871. bp := tls.Alloc(4)
  872. defer tls.Free(4)
  873. var ws2 uintptr
  874. // var buf [4]int8 at bp, 4
  875. var N size_t = n
  876. var l size_t
  877. if !(s != 0) {
  878. n = size_t(0)
  879. ws2 = *(*uintptr)(unsafe.Pointer(ws))
  880. for ; *(*wchar_t)(unsafe.Pointer(ws2)) != 0; ws2 += 2 {
  881. if uint32(*(*wchar_t)(unsafe.Pointer(ws2))) >= 0x80 {
  882. l = Xwcrtomb(tls, bp, *(*wchar_t)(unsafe.Pointer(ws2)), uintptr(0))
  883. if !(l+size_t(1) != 0) {
  884. return Uint32FromInt32(-1)
  885. }
  886. n = n + l
  887. } else {
  888. n++
  889. }
  890. }
  891. return n
  892. }
  893. for n >= size_t(4) {
  894. if uint32(*(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws)))))-1 >= 0x7f {
  895. if !(int32(*(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws))))) != 0) {
  896. *(*int8)(unsafe.Pointer(s)) = int8(0)
  897. *(*uintptr)(unsafe.Pointer(ws)) = uintptr(0)
  898. return N - n
  899. }
  900. l = Xwcrtomb(tls, s, *(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws)))), uintptr(0))
  901. if !(l+size_t(1) != 0) {
  902. return Uint32FromInt32(-1)
  903. }
  904. s += uintptr(l)
  905. n = n - l
  906. } else {
  907. *(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = int8(*(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws)))))
  908. n--
  909. }
  910. *(*uintptr)(unsafe.Pointer(ws)) += 2
  911. }
  912. for n != 0 {
  913. if uint32(*(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws)))))-1 >= 0x7f {
  914. if !(int32(*(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws))))) != 0) {
  915. *(*int8)(unsafe.Pointer(s)) = int8(0)
  916. *(*uintptr)(unsafe.Pointer(ws)) = uintptr(0)
  917. return N - n
  918. }
  919. l = Xwcrtomb(tls, bp, *(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws)))), uintptr(0))
  920. if !(l+size_t(1) != 0) {
  921. return Uint32FromInt32(-1)
  922. }
  923. if l > n {
  924. return N - n
  925. }
  926. Xwcrtomb(tls, s, *(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws)))), uintptr(0))
  927. s += uintptr(l)
  928. n = n - l
  929. } else {
  930. *(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = int8(*(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws)))))
  931. n--
  932. }
  933. *(*uintptr)(unsafe.Pointer(ws)) += 2
  934. }
  935. return N
  936. }
  937. func Xwcstombs(tls *TLS, s uintptr, ws uintptr, n size_t) size_t { /* wcstombs.c:4:8: */
  938. if __ccgo_strace {
  939. trc("tls=%v s=%v ws=%v n=%v, (%v:)", tls, s, ws, n, origin(2))
  940. }
  941. bp := tls.Alloc(4)
  942. defer tls.Free(4)
  943. *(*uintptr)(unsafe.Pointer(bp)) = ws
  944. //TODO return wcsrtombs(s, &(const wchar_t *){ws}, n, 0);
  945. return Xwcsrtombs(tls, s, bp, n, uintptr(0))
  946. }
  947. // Support signed or unsigned plain-char
  948. // Implementation choices...
  949. // Arbitrary numbers...
  950. // POSIX/SUS requirements follow. These numbers come directly
  951. // from SUS and have nothing to do with the host system.
  952. func X__strchrnul(tls *TLS, s uintptr, c int32) uintptr { /* strchrnul.c:10:6: */
  953. if __ccgo_strace {
  954. trc("tls=%v s=%v c=%v, (%v:)", tls, s, c, origin(2))
  955. }
  956. c = int32(uint8(c))
  957. if !(c != 0) {
  958. return s + uintptr(Xstrlen(tls, s))
  959. }
  960. var w uintptr
  961. for ; uintptr_t(s)%uintptr_t(unsafe.Sizeof(size_t(0))) != 0; s++ {
  962. if !(int32(*(*int8)(unsafe.Pointer(s))) != 0) || int32(*(*uint8)(unsafe.Pointer(s))) == c {
  963. return s
  964. }
  965. }
  966. var k size_t = Uint32(Uint32FromInt32(-1)) / size_t(255) * size_t(c)
  967. for w = s; !((*(*uint32)(unsafe.Pointer(w))-Uint32(Uint32FromInt32(-1))/size_t(255)) & ^*(*uint32)(unsafe.Pointer(w)) & (Uint32(Uint32FromInt32(-1))/size_t(255)*size_t(255/2+1)) != 0) && !((*(*uint32)(unsafe.Pointer(w))^k-Uint32(Uint32FromInt32(-1))/size_t(255)) & ^(*(*uint32)(unsafe.Pointer(w))^k) & (Uint32(Uint32FromInt32(-1))/size_t(255)*size_t(255/2+1)) != 0); w += 4 {
  968. }
  969. s = w
  970. for ; *(*int8)(unsafe.Pointer(s)) != 0 && int32(*(*uint8)(unsafe.Pointer(s))) != c; s++ {
  971. }
  972. return s
  973. }
  974. func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */
  975. if __ccgo_strace {
  976. trc("tls=%v s=%v, (%v:)", tls, s, origin(2))
  977. }
  978. var l size_t = Xstrlen(tls, s)
  979. var d uintptr = Xmalloc(tls, l+size_t(1))
  980. if !(d != 0) {
  981. return uintptr(0)
  982. }
  983. return Xmemcpy(tls, d, s, l+size_t(1))
  984. }