@zigc/lib 0.16.0-test.1 → 0.17.0-dev.131

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (352) hide show
  1. package/LICENSE +19 -0
  2. package/c/fcntl.zig +6 -1
  3. package/c/inttypes.zig +0 -10
  4. package/c/math.zig +138 -114
  5. package/c/pthread.zig +57 -0
  6. package/c/search.zig +1 -27
  7. package/c/stdlib/drand48.zig +0 -57
  8. package/c/stdlib.zig +0 -100
  9. package/c/string.zig +20 -7
  10. package/c/strings.zig +0 -38
  11. package/c/stropts.zig +17 -0
  12. package/c/unistd.zig +27 -26
  13. package/c/wchar.zig +10 -0
  14. package/c.zig +3 -2
  15. package/compiler/aro/aro/Attribute/names.zig +604 -589
  16. package/compiler/aro/aro/Attribute.zig +202 -116
  17. package/compiler/aro/aro/Builtins/common.zig +874 -863
  18. package/compiler/aro/aro/Builtins/eval.zig +15 -7
  19. package/compiler/aro/aro/Builtins.zig +0 -1
  20. package/compiler/aro/aro/CodeGen.zig +8 -7
  21. package/compiler/aro/aro/Compilation.zig +137 -111
  22. package/compiler/aro/aro/Diagnostics.zig +21 -17
  23. package/compiler/aro/aro/Driver/GCCDetector.zig +635 -0
  24. package/compiler/aro/aro/Driver.zig +138 -63
  25. package/compiler/aro/aro/LangOpts.zig +12 -2
  26. package/compiler/aro/aro/Parser/Diagnostic.zig +79 -19
  27. package/compiler/aro/aro/Parser.zig +352 -153
  28. package/compiler/aro/aro/Pragma.zig +3 -2
  29. package/compiler/aro/aro/Preprocessor/Diagnostic.zig +21 -0
  30. package/compiler/aro/aro/Preprocessor.zig +136 -62
  31. package/compiler/aro/aro/Target.zig +17 -12
  32. package/compiler/aro/aro/Tokenizer.zig +31 -14
  33. package/compiler/aro/aro/Toolchain.zig +4 -7
  34. package/compiler/aro/aro/Tree.zig +178 -148
  35. package/compiler/aro/aro/TypeStore.zig +82 -24
  36. package/compiler/aro/aro/Value.zig +13 -17
  37. package/compiler/aro/aro/features.zig +1 -0
  38. package/compiler/aro/aro/pragmas/message.zig +3 -2
  39. package/compiler/aro/aro/pragmas/once.zig +0 -1
  40. package/compiler/aro/aro/record_layout.zig +3 -3
  41. package/compiler/aro/aro/text_literal.zig +3 -2
  42. package/compiler/aro/assembly_backend/x86_64.zig +7 -8
  43. package/compiler/aro/backend/Assembly.zig +1 -2
  44. package/compiler/aro/backend/Interner.zig +2 -2
  45. package/compiler/aro/backend/Ir.zig +100 -92
  46. package/compiler/aro/include/ptrcheck.h +49 -0
  47. package/compiler/aro/main.zig +26 -10
  48. package/compiler/build_runner.zig +1 -2
  49. package/compiler/objdump.zig +93 -0
  50. package/compiler/reduce/Walk.zig +7 -7
  51. package/compiler/reduce.zig +5 -1
  52. package/compiler/resinator/compile.zig +2 -2
  53. package/compiler/resinator/main.zig +7 -1
  54. package/compiler/resinator/preprocess.zig +1 -3
  55. package/compiler/std-docs.zig +8 -1
  56. package/compiler/test_runner.zig +194 -62
  57. package/compiler/translate-c/MacroTranslator.zig +80 -11
  58. package/compiler/translate-c/PatternList.zig +1 -9
  59. package/compiler/translate-c/Scope.zig +43 -6
  60. package/compiler/translate-c/Translator.zig +369 -127
  61. package/compiler/translate-c/ast.zig +19 -11
  62. package/compiler/translate-c/main.zig +76 -17
  63. package/compiler_rt/cos.zig +140 -53
  64. package/compiler_rt/divmodei4.zig +40 -17
  65. package/compiler_rt/exp.zig +1 -6
  66. package/compiler_rt/exp2.zig +1 -6
  67. package/compiler_rt/exp_f128.zig +377 -0
  68. package/compiler_rt/fabs.zig +0 -2
  69. package/compiler_rt/fma.zig +0 -2
  70. package/compiler_rt/fmax.zig +0 -2
  71. package/compiler_rt/fmin.zig +0 -2
  72. package/compiler_rt/fmod.zig +0 -2
  73. package/compiler_rt/limb64.zig +1127 -0
  74. package/compiler_rt/log.zig +0 -2
  75. package/compiler_rt/log10.zig +0 -2
  76. package/compiler_rt/log2.zig +0 -2
  77. package/compiler_rt/long_double.zig +37 -0
  78. package/compiler_rt/mulXi3.zig +1 -1
  79. package/compiler_rt/mulo.zig +6 -1
  80. package/compiler_rt/rem_pio2l.zig +173 -0
  81. package/compiler_rt/round.zig +0 -2
  82. package/compiler_rt/sin.zig +139 -56
  83. package/compiler_rt/sincos.zig +277 -72
  84. package/compiler_rt/sqrt.zig +0 -2
  85. package/compiler_rt/ssp.zig +1 -1
  86. package/compiler_rt/tan.zig +117 -48
  87. package/compiler_rt/trig.zig +256 -6
  88. package/compiler_rt/trunc.zig +0 -2
  89. package/compiler_rt/udivmodei4.zig +28 -0
  90. package/compiler_rt.zig +2 -0
  91. package/fuzzer.zig +857 -307
  92. package/libc/musl/arch/mipsn32/syscall_arch.h +35 -32
  93. package/libc/musl/src/math/pow.c +343 -0
  94. package/package.json +1 -1
  95. package/std/Build/Cache.zig +6 -6
  96. package/std/Build/Fuzz.zig +6 -19
  97. package/std/Build/Module.zig +1 -1
  98. package/std/Build/Step/CheckObject.zig +3 -3
  99. package/std/Build/Step/Compile.zig +18 -1
  100. package/std/Build/Step/ConfigHeader.zig +49 -33
  101. package/std/Build/Step/InstallArtifact.zig +18 -0
  102. package/std/Build/Step/Run.zig +538 -89
  103. package/std/Build/Step/TranslateC.zig +0 -6
  104. package/std/Build/Step.zig +10 -19
  105. package/std/Build/WebServer.zig +31 -19
  106. package/std/Build/abi.zig +47 -11
  107. package/std/Build.zig +17 -17
  108. package/std/Io/Dir.zig +7 -2
  109. package/std/Io/Dispatch.zig +5 -13
  110. package/std/Io/File/Reader.zig +3 -1
  111. package/std/Io/File/Writer.zig +8 -6
  112. package/std/Io/File.zig +1 -0
  113. package/std/Io/Kqueue.zig +2 -2
  114. package/std/Io/Reader.zig +8 -9
  115. package/std/Io/Semaphore.zig +112 -17
  116. package/std/Io/Terminal.zig +1 -1
  117. package/std/Io/Threaded.zig +352 -180
  118. package/std/Io/Uring.zig +15 -16
  119. package/std/Io/Writer.zig +46 -42
  120. package/std/Io/net.zig +11 -11
  121. package/std/Io.zig +1052 -20
  122. package/std/SemanticVersion.zig +1 -1
  123. package/std/Target/Query.zig +2 -2
  124. package/std/Target.zig +53 -7
  125. package/std/Thread.zig +8 -3
  126. package/std/array_hash_map.zig +105 -573
  127. package/std/array_list.zig +22 -31
  128. package/std/bit_set.zig +22 -6
  129. package/std/builtin/assembly.zig +68 -0
  130. package/std/builtin.zig +4 -0
  131. package/std/c/haiku.zig +3 -0
  132. package/std/c/serenity.zig +1 -6
  133. package/std/c.zig +106 -24
  134. package/std/compress/flate/Compress.zig +3 -3
  135. package/std/compress/flate/Decompress.zig +2 -3
  136. package/std/compress/zstd/Decompress.zig +2 -4
  137. package/std/crypto/Certificate/Bundle.zig +15 -1
  138. package/std/crypto/Certificate.zig +13 -1
  139. package/std/crypto/ascon.zig +75 -33
  140. package/std/crypto/codecs/asn1/Oid.zig +12 -1
  141. package/std/crypto/codecs/asn1.zig +33 -18
  142. package/std/crypto/codecs/base64_hex_ct.zig +16 -8
  143. package/std/crypto/ml_kem.zig +2 -9
  144. package/std/crypto/tls/Client.zig +79 -4
  145. package/std/crypto/tls.zig +1 -1
  146. package/std/crypto.zig +1 -0
  147. package/std/debug/Dwarf.zig +29 -9
  148. package/std/debug/Info.zig +4 -0
  149. package/std/debug/MachOFile.zig +46 -8
  150. package/std/debug/Pdb.zig +540 -37
  151. package/std/debug/SelfInfo/Elf.zig +19 -18
  152. package/std/debug/SelfInfo/MachO.zig +18 -7
  153. package/std/debug/SelfInfo/Windows.zig +138 -36
  154. package/std/debug.zig +181 -66
  155. package/std/enums.zig +25 -19
  156. package/std/fmt.zig +8 -3
  157. package/std/fs/path.zig +6 -4
  158. package/std/heap/ArenaAllocator.zig +145 -154
  159. package/std/heap/BufferFirstAllocator.zig +165 -0
  160. package/std/heap/debug_allocator.zig +7 -7
  161. package/std/heap.zig +2 -126
  162. package/std/http/Client.zig +31 -30
  163. package/std/http.zig +14 -13
  164. package/std/json/Scanner.zig +2 -2
  165. package/std/json/Stringify.zig +3 -3
  166. package/std/json/dynamic.zig +4 -4
  167. package/std/math/big/int.zig +16 -17
  168. package/std/mem/Allocator.zig +4 -5
  169. package/std/mem.zig +48 -0
  170. package/std/os/emscripten.zig +2 -18
  171. package/std/os/linux/IoUring.zig +2 -0
  172. package/std/os/linux/aarch64.zig +41 -12
  173. package/std/os/linux/arc.zig +173 -0
  174. package/std/os/linux/arm.zig +41 -12
  175. package/std/os/linux/hexagon.zig +33 -11
  176. package/std/os/linux/loongarch32.zig +41 -13
  177. package/std/os/linux/loongarch64.zig +41 -12
  178. package/std/os/linux/m68k.zig +41 -13
  179. package/std/os/linux/mips.zig +67 -36
  180. package/std/os/linux/mips64.zig +60 -29
  181. package/std/os/linux/mipsn32.zig +60 -29
  182. package/std/os/linux/or1k.zig +41 -12
  183. package/std/os/linux/powerpc.zig +41 -12
  184. package/std/os/linux/powerpc64.zig +41 -12
  185. package/std/os/linux/riscv32.zig +41 -12
  186. package/std/os/linux/riscv64.zig +41 -12
  187. package/std/os/linux/s390x.zig +44 -7
  188. package/std/os/linux/sparc64.zig +83 -52
  189. package/std/os/linux/thumb.zig +52 -36
  190. package/std/os/linux/x32.zig +41 -12
  191. package/std/os/linux/x86.zig +42 -13
  192. package/std/os/linux/x86_64.zig +41 -12
  193. package/std/os/linux.zig +419 -438
  194. package/std/os/uefi/tables/boot_services.zig +9 -8
  195. package/std/os/windows.zig +2 -2
  196. package/std/os.zig +41 -0
  197. package/std/pdb.zig +143 -4
  198. package/std/posix.zig +6 -12
  199. package/std/priority_dequeue.zig +13 -12
  200. package/std/priority_queue.zig +5 -4
  201. package/std/process/Child.zig +1 -1
  202. package/std/process/Environ.zig +1 -1
  203. package/std/process.zig +1 -1
  204. package/std/sort.zig +3 -3
  205. package/std/start.zig +17 -4
  206. package/std/std.zig +19 -6
  207. package/std/testing/FailingAllocator.zig +4 -4
  208. package/std/testing/Smith.zig +37 -2
  209. package/std/zig/Ast/Render.zig +187 -459
  210. package/std/zig/Ast.zig +0 -4
  211. package/std/zig/AstGen.zig +86 -103
  212. package/std/zig/AstRlAnnotate.zig +0 -11
  213. package/std/zig/AstSmith.zig +2602 -0
  214. package/std/zig/BuiltinFn.zig +0 -32
  215. package/std/zig/Client.zig +8 -3
  216. package/std/zig/LibCInstallation.zig +4 -3
  217. package/std/zig/Parse.zig +90 -81
  218. package/std/zig/Server.zig +26 -0
  219. package/std/zig/WindowsSdk.zig +13 -13
  220. package/std/zig/Zir.zig +66 -62
  221. package/std/zig/ZonGen.zig +6 -5
  222. package/std/zig/c_translation/helpers.zig +14 -9
  223. package/std/zig/llvm/Builder.zig +119 -60
  224. package/std/zig/system.zig +20 -4
  225. package/std/zig/tokenizer.zig +2 -1
  226. package/std/zig.zig +7 -10
  227. package/std/zip.zig +5 -5
  228. package/zig.h +340 -1
  229. package/compiler/aro/aro/Driver/Filesystem.zig +0 -241
  230. package/libc/mingw/complex/cabs.c +0 -48
  231. package/libc/mingw/complex/cabsf.c +0 -48
  232. package/libc/mingw/complex/cacos.c +0 -50
  233. package/libc/mingw/complex/cacosf.c +0 -50
  234. package/libc/mingw/complex/carg.c +0 -48
  235. package/libc/mingw/complex/cargf.c +0 -48
  236. package/libc/mingw/complex/casin.c +0 -50
  237. package/libc/mingw/complex/casinf.c +0 -50
  238. package/libc/mingw/complex/catan.c +0 -50
  239. package/libc/mingw/complex/catanf.c +0 -50
  240. package/libc/mingw/complex/ccos.c +0 -50
  241. package/libc/mingw/complex/ccosf.c +0 -50
  242. package/libc/mingw/complex/cexp.c +0 -48
  243. package/libc/mingw/complex/cexpf.c +0 -48
  244. package/libc/mingw/complex/cimag.c +0 -48
  245. package/libc/mingw/complex/cimagf.c +0 -48
  246. package/libc/mingw/complex/clog.c +0 -48
  247. package/libc/mingw/complex/clog10.c +0 -49
  248. package/libc/mingw/complex/clog10f.c +0 -49
  249. package/libc/mingw/complex/clogf.c +0 -48
  250. package/libc/mingw/complex/conj.c +0 -48
  251. package/libc/mingw/complex/conjf.c +0 -48
  252. package/libc/mingw/complex/cpow.c +0 -48
  253. package/libc/mingw/complex/cpowf.c +0 -48
  254. package/libc/mingw/complex/cproj.c +0 -48
  255. package/libc/mingw/complex/cprojf.c +0 -48
  256. package/libc/mingw/complex/creal.c +0 -48
  257. package/libc/mingw/complex/crealf.c +0 -48
  258. package/libc/mingw/complex/csin.c +0 -50
  259. package/libc/mingw/complex/csinf.c +0 -50
  260. package/libc/mingw/complex/csqrt.c +0 -48
  261. package/libc/mingw/complex/csqrtf.c +0 -48
  262. package/libc/mingw/complex/ctan.c +0 -50
  263. package/libc/mingw/complex/ctanf.c +0 -50
  264. package/libc/mingw/math/arm/s_rint.c +0 -86
  265. package/libc/mingw/math/arm/s_rintf.c +0 -51
  266. package/libc/mingw/math/arm/sincos.S +0 -30
  267. package/libc/mingw/math/arm-common/sincosl.c +0 -13
  268. package/libc/mingw/math/arm64/rint.c +0 -12
  269. package/libc/mingw/math/arm64/rintf.c +0 -12
  270. package/libc/mingw/math/arm64/sincos.S +0 -32
  271. package/libc/mingw/math/bsd_private_base.h +0 -148
  272. package/libc/mingw/math/fdiml.c +0 -24
  273. package/libc/mingw/math/frexpf.c +0 -13
  274. package/libc/mingw/math/frexpl.c +0 -71
  275. package/libc/mingw/math/x86/acosf.c +0 -29
  276. package/libc/mingw/math/x86/atanf.c +0 -23
  277. package/libc/mingw/math/x86/atanl.c +0 -18
  278. package/libc/mingw/math/x86/cos.def.h +0 -65
  279. package/libc/mingw/math/x86/cosl.c +0 -46
  280. package/libc/mingw/math/x86/cosl_internal.S +0 -55
  281. package/libc/mingw/math/x86/ldexp.c +0 -23
  282. package/libc/mingw/math/x86/scalbn.S +0 -41
  283. package/libc/mingw/math/x86/scalbnf.S +0 -40
  284. package/libc/mingw/math/x86/sin.def.h +0 -65
  285. package/libc/mingw/math/x86/sinl.c +0 -46
  286. package/libc/mingw/math/x86/sinl_internal.S +0 -58
  287. package/libc/mingw/math/x86/tanl.S +0 -62
  288. package/libc/mingw/misc/btowc.c +0 -28
  289. package/libc/mingw/misc/wcstof.c +0 -66
  290. package/libc/mingw/misc/wcstoimax.c +0 -132
  291. package/libc/mingw/misc/wcstoumax.c +0 -126
  292. package/libc/mingw/misc/wctob.c +0 -29
  293. package/libc/mingw/misc/winbs_uint64.c +0 -6
  294. package/libc/mingw/misc/winbs_ulong.c +0 -6
  295. package/libc/mingw/misc/winbs_ushort.c +0 -6
  296. package/libc/mingw/stdio/_Exit.c +0 -10
  297. package/libc/mingw/stdio/_findfirst64i32.c +0 -21
  298. package/libc/mingw/stdio/_findnext64i32.c +0 -21
  299. package/libc/mingw/stdio/_fstat64i32.c +0 -37
  300. package/libc/mingw/stdio/_stat64i32.c +0 -37
  301. package/libc/mingw/stdio/_wfindfirst64i32.c +0 -21
  302. package/libc/mingw/stdio/_wfindnext64i32.c +0 -21
  303. package/libc/mingw/stdio/_wstat64i32.c +0 -37
  304. package/libc/mingw/winpthreads/spinlock.c +0 -82
  305. package/libc/musl/src/legacy/isastream.c +0 -7
  306. package/libc/musl/src/legacy/valloc.c +0 -8
  307. package/libc/musl/src/linux/tee.c +0 -8
  308. package/libc/musl/src/math/__cosl.c +0 -96
  309. package/libc/musl/src/math/__sinl.c +0 -78
  310. package/libc/musl/src/math/__tanl.c +0 -143
  311. package/libc/musl/src/math/aarch64/lrint.c +0 -10
  312. package/libc/musl/src/math/aarch64/lrintf.c +0 -10
  313. package/libc/musl/src/math/aarch64/rintf.c +0 -7
  314. package/libc/musl/src/math/cosl.c +0 -39
  315. package/libc/musl/src/math/fdim.c +0 -10
  316. package/libc/musl/src/math/fdimf.c +0 -10
  317. package/libc/musl/src/math/fdiml.c +0 -18
  318. package/libc/musl/src/math/finite.c +0 -7
  319. package/libc/musl/src/math/finitef.c +0 -7
  320. package/libc/musl/src/math/frexp.c +0 -23
  321. package/libc/musl/src/math/frexpf.c +0 -23
  322. package/libc/musl/src/math/frexpl.c +0 -29
  323. package/libc/musl/src/math/i386/lrint.c +0 -8
  324. package/libc/musl/src/math/i386/lrintf.c +0 -8
  325. package/libc/musl/src/math/i386/rintf.c +0 -7
  326. package/libc/musl/src/math/lrint.c +0 -72
  327. package/libc/musl/src/math/lrintf.c +0 -8
  328. package/libc/musl/src/math/powerpc64/lrint.c +0 -16
  329. package/libc/musl/src/math/powerpc64/lrintf.c +0 -16
  330. package/libc/musl/src/math/rintf.c +0 -30
  331. package/libc/musl/src/math/s390x/rintf.c +0 -15
  332. package/libc/musl/src/math/sincosl.c +0 -60
  333. package/libc/musl/src/math/sinl.c +0 -41
  334. package/libc/musl/src/math/tanl.c +0 -29
  335. package/libc/musl/src/math/x32/lrint.s +0 -5
  336. package/libc/musl/src/math/x32/lrintf.s +0 -5
  337. package/libc/musl/src/math/x86_64/lrint.c +0 -8
  338. package/libc/musl/src/math/x86_64/lrintf.c +0 -8
  339. package/libc/musl/src/string/strdup.c +0 -10
  340. package/libc/musl/src/string/strndup.c +0 -12
  341. package/libc/musl/src/string/wcsdup.c +0 -10
  342. package/libc/musl/src/thread/pthread_spin_destroy.c +0 -6
  343. package/libc/musl/src/thread/pthread_spin_init.c +0 -6
  344. package/libc/musl/src/thread/pthread_spin_lock.c +0 -8
  345. package/libc/musl/src/thread/pthread_spin_trylock.c +0 -7
  346. package/libc/musl/src/thread/pthread_spin_unlock.c +0 -7
  347. package/libc/musl/src/unistd/dup2.c +0 -20
  348. package/libc/musl/src/unistd/dup3.c +0 -26
  349. package/libc/wasi/libc-bottom-half/sources/reallocarray.c +0 -14
  350. package/libc/wasi/thread-stub/pthread_spin_lock.c +0 -8
  351. package/libc/wasi/thread-stub/pthread_spin_trylock.c +0 -8
  352. package/libc/wasi/thread-stub/pthread_spin_unlock.c +0 -7
package/std/Io/Uring.zig CHANGED
@@ -779,7 +779,6 @@ pub fn io(ev: *Evented) Io {
779
779
  .netConnectUnix = netConnectUnixUnavailable,
780
780
  .netSocketCreatePair = netSocketCreatePairUnavailable,
781
781
  .netSend = netSendUnavailable,
782
- .netRead = netReadUnavailable,
783
782
  .netWrite = netWriteUnavailable,
784
783
  .netWriteFile = netWriteFileUnavailable,
785
784
  .netClose = netClose,
@@ -2105,6 +2104,12 @@ fn operate(userdata: ?*anyopaque, operation: Io.Operation) Io.Cancelable!Io.Oper
2105
2104
  };
2106
2105
  },
2107
2106
  },
2107
+ .net_read => |o| .{
2108
+ .net_read = r: {
2109
+ _ = o;
2110
+ break :r error.NetworkDown; // TODO
2111
+ },
2112
+ },
2108
2113
  };
2109
2114
  }
2110
2115
 
@@ -2392,6 +2397,10 @@ fn batchDrainSubmitted(
2392
2397
  _ = o;
2393
2398
  @panic("TODO implement batchDrainSubmitted for net_receive");
2394
2399
  },
2400
+ .net_read => |o| {
2401
+ _ = o;
2402
+ @panic("TODO implement batchDrainSubmitted for net_read");
2403
+ },
2395
2404
  })) |result| {
2396
2405
  switch (batch.completed.tail) {
2397
2406
  .none => batch.completed.head = index,
@@ -2493,6 +2502,7 @@ fn batchDrainReady(batch: *Io.Batch) Io.Timeout.Error!void {
2493
2502
  },
2494
2503
  .device_io_control => unreachable,
2495
2504
  .net_receive => @panic("TODO"),
2505
+ .net_read => @panic("TODO"),
2496
2506
  })) |result| {
2497
2507
  switch (batch.completed.tail) {
2498
2508
  .none => batch.completed.head = index,
@@ -3060,7 +3070,7 @@ fn dirRead(userdata: ?*anyopaque, dr: *Dir.Reader, buffer: []Dir.Entry) Dir.Read
3060
3070
  }
3061
3071
  const n = while (true) {
3062
3072
  try sync.cancel_region.await(.nothing);
3063
- const rc = linux.getdents64(dr.dir.handle, dr.buffer.ptr, dr.buffer.len);
3073
+ const rc = linux.getdents64(dr.dir.handle, dr.buffer.ptr, @min(dr.buffer.len, std.math.maxInt(c_uint)));
3064
3074
  switch (linux.errno(rc)) {
3065
3075
  .SUCCESS => break rc,
3066
3076
  .INTR => {},
@@ -4729,7 +4739,7 @@ fn childWait(userdata: ?*anyopaque, child: *process.Child) process.Child.WaitErr
4729
4739
  return switch (code) {
4730
4740
  .EXITED => .{ .exited = @truncate(status) },
4731
4741
  .KILLED, .DUMPED => .{ .signal = @enumFromInt(status) },
4732
- .TRAPPED, .STOPPED => .{ .stopped = status },
4742
+ .TRAPPED, .STOPPED => .{ .stopped = @enumFromInt(status) },
4733
4743
  _, .CONTINUED => .{ .unknown = status },
4734
4744
  };
4735
4745
  },
@@ -4948,7 +4958,7 @@ fn randomSecure(userdata: ?*anyopaque, buffer: []u8) Io.RandomSecureError!void {
4948
4958
  var cancel_region: CancelRegion = .init();
4949
4959
  defer cancel_region.deinit();
4950
4960
  ev.urandomReadAll(&cancel_region, buffer) catch |err| switch (err) {
4951
- error.Canceled => return error.Canceled,
4961
+ error.Canceled => |e| return e,
4952
4962
  else => return error.EntropyUnavailable,
4953
4963
  };
4954
4964
  }
@@ -5142,18 +5152,6 @@ fn netReceive(
5142
5152
  }
5143
5153
  }
5144
5154
 
5145
- fn netReadUnavailable(
5146
- userdata: ?*anyopaque,
5147
- fd: net.Socket.Handle,
5148
- data: [][]u8,
5149
- ) net.Stream.Reader.Error!usize {
5150
- const ev: *Evented = @ptrCast(@alignCast(userdata));
5151
- _ = ev;
5152
- _ = fd;
5153
- _ = data;
5154
- return error.NetworkDown;
5155
- }
5156
-
5157
5155
  fn netWriteUnavailable(
5158
5156
  userdata: ?*anyopaque,
5159
5157
  handle: net.Socket.Handle,
@@ -5673,6 +5671,7 @@ fn openat(
5673
5671
  .AGAIN => return error.WouldBlock,
5674
5672
  .TXTBSY => return error.FileBusy,
5675
5673
  .NXIO => return error.NoDevice,
5674
+ .ROFS => return error.ReadOnlyFileSystem,
5676
5675
  .ILSEQ => return error.BadPathName,
5677
5676
  else => |err| return unexpectedErrno(err),
5678
5677
  }
package/std/Io/Writer.zig CHANGED
@@ -551,64 +551,68 @@ pub fn writeAll(w: *Writer, bytes: []const u8) Error!void {
551
551
  while (index < bytes.len) index += try w.write(bytes[index..]);
552
552
  }
553
553
 
554
- /// Renders fmt string with args, calling `writer` with slices of bytes.
555
- /// If `writer` returns an error, the error is returned from `format` and
556
- /// `writer` is not called again.
554
+ /// Renders `fmt` string with `args`, calling `w` with slices of bytes.
557
555
  ///
558
- /// The format string must be comptime-known and may contain placeholders following
559
- /// this format:
560
- /// `{[argument][specifier]:[fill][alignment][width].[precision]}`
556
+ /// The format string must be comptime-known and may contain placeholders
557
+ /// following this format:
558
+ /// ```
559
+ /// {[argument][specifier]:[fill][alignment][width].[precision]}
560
+ /// ```
561
561
  ///
562
- /// Above, each word including its surrounding [ and ] is a parameter which you have to replace with something:
562
+ /// Above, each word including its surrounding [ and ] is a parameter to be replaced with:
563
563
  ///
564
- /// - *argument* is either the numeric index or the field name of the argument that should be inserted
565
- /// - when using a field name, you are required to enclose the field name (an identifier) in square
566
- /// brackets, e.g. {[score]...} as opposed to the numeric index form which can be written e.g. {2...}
567
- /// - *specifier* is a type-dependent formatting option that determines how a type should formatted (see below)
568
- /// - *fill* is a single byte which is used to pad formatted numbers.
569
- /// - *alignment* is one of the three bytes '<', '^', or '>' to make numbers
564
+ /// - **argument** is either the numeric index or the field name of the argument that should be inserted.
565
+ /// - When using a field name, the field name (an identifier) must be enclosed in square
566
+ /// brackets, e.g. `{[score]...}` as opposed to the numeric index form which can be written e.g. `{2...}`.
567
+ /// - **specifier** is a type-dependent formatting option that determines how a type should formatted (see below).
568
+ /// - **fill** is a single byte which is used to pad formatted numbers.
569
+ /// - **alignment** is one of the three bytes '<', '^', or '>' to make numbers
570
570
  /// left, center, or right-aligned, respectively.
571
571
  /// - Not all specifiers support alignment.
572
- /// - Alignment is not Unicode-aware; appropriate only when used with raw bytes or ASCII.
573
- /// - *width* is the total width of the field in bytes. This only applies to number formatting.
574
- /// - *precision* specifies how many decimals a formatted number should have.
572
+ /// - Alignment is not Unicode-aware; appropriate only when used with raw
573
+ /// bytes or ASCII.
574
+ /// - **width** is the total size of the field in bytes, only applicable to
575
+ /// number formatting.
576
+ /// - **precision** specifies how many decimals a formatted number should have.
575
577
  ///
576
- /// Note that most of the parameters are optional and may be omitted. Also you
577
- /// can leave out separators like `:` and `.` when all parameters after the
578
- /// separator are omitted.
578
+ /// Most of the parameters are optional and may be omitted. The separators (':'
579
+ /// and '.') may be omitted when all parameters afterwards are omitted.
579
580
  ///
580
- /// Only exception is the *fill* parameter. If a non-zero *fill* character is
581
- /// required at the same time as *width* is specified, one has to specify
582
- /// *alignment* as well, as otherwise the digit following `:` is interpreted as
583
- /// *width*, not *fill*.
581
+ /// The **fill** parameter is an exception. If a non-zero **fill** character is
582
+ /// required at the same time as **width** is specified, **alignment** is
583
+ /// required, otherwise the digit following ':' is interpreted as **width**.
584
584
  ///
585
- /// The *specifier* has several options for types:
586
- /// - `x` and `X`: output numeric value in hexadecimal notation, or string in hexadecimal bytes
585
+ /// **specifier** supports:
586
+ /// - `x` and `X`: numeric value in hexadecimal notation, or string in hexadecimal bytes
587
587
  /// - `s`:
588
588
  /// - for pointer-to-many and C pointers of u8, print as a C-string using zero-termination
589
589
  /// - for slices of u8, print the entire slice as a string without zero-termination
590
590
  /// - `t`:
591
591
  /// - for enums and tagged unions: prints the tag name
592
592
  /// - for error sets: prints the error name
593
- /// - `b64`: output string as standard base64
594
- /// - `e`: output floating point value in scientific notation
595
- /// - `d`: output numeric value in decimal notation
596
- /// - `b`: output integer value in binary notation
597
- /// - `o`: output integer value in octal notation
598
- /// - `c`: output integer as an ASCII character. Integer type must have 8 bits at max.
599
- /// - `u`: output integer as an UTF-8 sequence. Integer type must have 21 bits at max.
600
- /// - `D`: output nanoseconds as duration
601
- /// - `B`: output bytes in SI units (decimal)
602
- /// - `Bi`: output bytes in IEC units (binary)
603
- /// - `?`: output optional value as either the unwrapped value, or `null`; may be followed by a format specifier for the underlying value.
604
- /// - `!`: output error union value as either the unwrapped value, or the formatted error value; may be followed by a format specifier for the underlying value.
605
- /// - `*`: output the address of the value instead of the value itself.
606
- /// - `any`: output a value of any type using its default format.
607
- /// - `f`: delegates to a method on the type named "format" with the signature `fn (*Writer, args: anytype) Writer.Error!void`.
593
+ /// - `b64`: string as standard base64
594
+ /// - `e`: floating point value in scientific notation
595
+ /// - `d`: numeric value in decimal notation
596
+ /// - `b`: integer value in binary notation
597
+ /// - `o`: integer value in octal notation
598
+ /// - `c`: integer as an ASCII character. Integer type must have 8 bits at max.
599
+ /// - `u`: integer as an UTF-8 sequence. Integer type must have 21 bits at max.
600
+ /// - `B`: bytes in SI units (decimal)
601
+ /// - `Bi`: bytes in IEC units (binary)
602
+ /// - `?`: optional value as either the unwrapped value, or `null`; may be
603
+ /// followed by a format specifier for the underlying value.
604
+ /// - `!`: error union value as either the unwrapped value, or the formatted
605
+ /// error value; may be followed by a format specifier for the underlying
606
+ /// value.
607
+ /// - `*`: the address of the value instead of the value itself.
608
+ /// - `any`: a value of any type using its default format.
609
+ /// - `f`: delegates to the `format` method of the type, passing `*Writer` and
610
+ /// expecting `Error!void` returned.
608
611
  ///
609
- /// A user type may be a `struct`, `vector`, `union` or `enum` type.
612
+ /// A user type may be a struct, vector, union or enum type.
610
613
  ///
611
- /// To print literal curly braces, escape them by writing them twice, e.g. `{{` or `}}`.
614
+ /// Literal curly braces can be escaped in the format string via doubling, e.g.
615
+ /// `{{` or `}}`.
612
616
  pub fn print(w: *Writer, comptime fmt: []const u8, args: anytype) Error!void {
613
617
  const ArgsType = @TypeOf(args);
614
618
  const args_type_info = @typeInfo(ArgsType);
package/std/Io/net.zig CHANGED
@@ -1245,6 +1245,15 @@ pub const Stream = struct {
1245
1245
 
1246
1246
  const max_iovecs_len = 8;
1247
1247
 
1248
+ /// This is a low-level API that calls the `Io` interface function directly.
1249
+ /// For a higher level API, see `reader`.
1250
+ pub fn read(s: *const Stream, io: Io, data: [][]u8) Reader.Error!usize {
1251
+ return (try io.operate(.{ .net_read = .{
1252
+ .socket_handle = s.socket.handle,
1253
+ .data = data,
1254
+ } })).net_read;
1255
+ }
1256
+
1248
1257
  pub fn close(s: *const Stream, io: Io) void {
1249
1258
  io.vtable.netClose(io.userdata, (&s.socket.handle)[0..1]);
1250
1259
  }
@@ -1259,16 +1268,7 @@ pub const Stream = struct {
1259
1268
  stream: Stream,
1260
1269
  err: ?Error,
1261
1270
 
1262
- pub const Error = error{
1263
- SystemResources,
1264
- ConnectionResetByPeer,
1265
- Timeout,
1266
- SocketUnconnected,
1267
- /// The file descriptor does not hold the required rights to read
1268
- /// from it.
1269
- AccessDenied,
1270
- NetworkDown,
1271
- } || Io.Cancelable || Io.UnexpectedError;
1271
+ pub const Error = Io.Operation.NetRead.Error || Io.Cancelable;
1272
1272
 
1273
1273
  pub fn init(stream: Stream, io: Io, buffer: []u8) Reader {
1274
1274
  return .{
@@ -1302,7 +1302,7 @@ pub const Stream = struct {
1302
1302
  const dest_n, const data_size = try io_r.writableVector(&iovecs_buffer, data);
1303
1303
  const dest = iovecs_buffer[0..dest_n];
1304
1304
  assert(dest[0].len > 0);
1305
- const n = io.vtable.netRead(io.userdata, r.stream.socket.handle, dest) catch |err| {
1305
+ const n = r.stream.read(io, dest) catch |err| {
1306
1306
  r.err = err;
1307
1307
  return error.ReadFailed;
1308
1308
  };