Andrew Kelley
0b3ca11520
std.Io.Writer: placeholder code for new {q} format character
...
intendend to print something with double quotes, escaped the same as a
zig string literal.
2026-05-25 18:54:33 -07:00
Andrew Kelley
c02d39a21c
std.Io.File: explain rationale for no Dir.setLength
...
closes #35353
2026-05-21 14:57:59 -07:00
Alex Rønne Petersen
fe6c3e58ef
std.Io.RwLock: disable lock canceling test on SPARC
...
https://codeberg.org/ziglang/zig/issues/35347
2026-05-19 20:07:00 +02:00
Alex Rønne Petersen
a8376afca9
Merge pull request 'add sparc64-linux-none to module test matrix' ( #35348 ) from alexrp/zig:sparc64-linux into master
...
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35348
2026-05-19 14:05:21 +02:00
linus
30698b03c0
Merge pull request 'std: Remove more deprecated functions' ( #35253 ) from linus/zig:more-deprecations into master
...
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35253
2026-05-19 11:41:52 +02:00
Ryan Liptak
71f23402bc
Writer: Fix splatBytePreserve losing data in certain cases
...
In cases where the now removed `preserve < w.end` branch was taken, some of the data in the buffer would never make it to logical sink. For example, in one of the newly added test cases where a buffer of 10 is filled with 9 bytes, and then `splatBytePreserve` is called with a preserve of 5 and a splat of 2, the 5 preserved bytes in the buffer would get memmoved to the front of the buffer in the `preserve < w.end` branch, clobbering the first 4 bytes (without any chance of them making it to the logical sink).
After this commit, `rebase` is called to allow the implementation to do the preservation while sending any relevant bytes to the logical sink in the process.
Addresses part of https://github.com/ziglang/zig/issues/24767
Supersedes https://github.com/ziglang/zig/pull/24875
2026-05-19 03:15:55 +02:00
EJ
5b647b792c
std.Io.Dir: doc comment for renamePreserve and tests ( #35317 )
...
Right now the comment specifies what will happen when "renaming a file _over_ ... or a directory _over_...". But the whole point of `renamePreserve` is not writing over anything.
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35317
Reviewed-by: Ryan Liptak <squeek502@noreply.codeberg.org >
2026-05-19 03:12:32 +02:00
Alex Rønne Petersen
3b330f1d7c
std: disable some failing cancelation tests on sparc64-linux
...
https://codeberg.org/ziglang/zig/issues/35347
2026-05-19 00:19:50 +02:00
Alex Rønne Petersen
3b41518c14
std: disable some tests that fail on sparc64
2026-05-18 21:39:34 +02:00
Linus Groh
33d2e571c7
std.mem: Remove containsAtLeastScalar() in favor of new impl
2026-05-08 22:04:30 +01:00
Andrew Kelley
cd23f7a814
Merge pull request 'std.meta: Remove Int/Tuple in favor of @Int/@Tuple' ( #35188 ) from linus/zig:deprecated-std-meta into master
...
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35188
Reviewed-by: Andrew Kelley <andrew@ziglang.org >
2026-05-06 19:35:40 +02:00
Andrew Kelley
3d56df1716
Merge pull request 'std.fmt, std.mem.Allocator: Remove bufPrintZ()/dupeZ() in favor of bufPrintSentinel()/dupeSentinel()' ( #35190 ) from linus/zig:deprecated-std-fmt-mem into master
...
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35190
Reviewed-by: Andrew Kelley <andrew@ziglang.org >
2026-05-06 19:34:52 +02:00
jeffkdev
a2ab3132df
wasm futex: fix invalid cast from u64 to i64
2026-05-06 15:47:04 +02:00
Linus Groh
0add2dfc41
std.Io.File: Remove deprecated option types
2026-05-05 04:12:52 +02:00
Linus Groh
fcc0a5a913
std.mem.Allocator: Remove dupeZ() in favor of dupeSentinel()
2026-05-03 21:42:16 +01:00
Linus Groh
cd10ce9a67
std.fmt: Remove bufPrintZ() in favor of bufPrintSentinel()
2026-05-03 21:42:16 +01:00
Linus Groh
991f56fd6b
std.meta: Remove Int in favor of @Int
2026-05-03 21:42:06 +01:00
Matthew Lugg
fdac89d6cd
remove uses of array multiplication
...
In preparation for its removal as accepted in
https://github.com/ziglang/zig/issues/24738 .
2026-04-30 08:57:51 +01:00
Matthew Lugg
213c4fc25f
lib,test: remove uses of i0
...
In preparation for its removal, as accepted in
https://github.com/ziglang/zig/issues/1593 .
2026-04-30 08:57:51 +01:00
GasInfinity
1deb029a66
std: rename bit_set variants and deprecate the managed one.
...
* aliases and deprecates the previous names.
* also update callsites to use the non-deprecated declarations.
2026-04-27 16:46:26 +02:00
Alex Rønne Petersen
bd12a5a6e1
std: re-enable a bunch of tests that now pass
...
closes https://github.com/ziglang/zig/issues/21893
closes https://github.com/ziglang/zig/issues/23806
closes https://github.com/ziglang/zig/issues/23807
closes https://github.com/ziglang/zig/issues/24191
closes https://codeberg.org/ziglang/zig/issues/30220
2026-04-25 21:54:48 +02:00
Jonathan Marler
23bcb8148f
add missing CONNECTION_REFUSED and CONNECTION_RESET errors for windows
...
Adds missing errors CONNECTION_REFUSED for netConnectIpWindows and
CONNECTION_RESET for both netReadWindows and netWriteWindows. I'm able
to induce these 3 errors on my Windows 11 machine.
2026-04-25 05:20:16 +02:00
Ryan Liptak
3252a05531
Prefer <err> => |e| return e over <err> => return <err>
...
Avoids the potential for a typo on the `return <err>` side of the prong
2026-04-20 18:03:14 -07:00
Andrew Kelley
50f96d2ca1
std.Io.Dir: add type checking for those two functions
2026-04-19 10:08:23 -07:00
Lukas Lalinsky
52e06ce4f6
std.Io.Dir: fix incorrect return types in setFileOwner and setTimestampsNow
...
`setFileOwner` declared `SetOwnerError!void` but its vtable method
returns the wider `SetFileOwnerError!void` (adds `NameTooLong` and
`BadPathName`), so any call through the wrapper fails to compile.
`setTimestampsNow` dispatched to `io.vtable.fileSetTimestamps` with
`(Dir, []const u8, Dir.SetTimestampsOptions)`, but that vtable entry
takes `(File, File.SetTimestampsOptions)`. The intended target is
`dirSetTimestamps`, whose signature matches the call site.
2026-04-19 10:07:44 -07:00
Meghan Denny
9636d76b6d
std.os.linux: getdents accepts a c_uint length ( #31825 )
...
https://github.com/torvalds/linux/blob/e774d5f1bc27a85f858bce7688509e866f8e8a4e/include/linux/syscalls.h#L1100-L1102
https://github.com/torvalds/linux/blob/e774d5f1bc27a85f858bce7688509e866f8e8a4e/include/linux/syscalls.h#L477-L479
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31825
Reviewed-by: Andrew Kelley <andrew@ziglang.org >
Co-authored-by: Meghan Denny <hello@nektro.net >
Co-committed-by: Meghan Denny <hello@nektro.net >
2026-04-18 07:34:32 +02:00
Linus Groh
b0ef8d3610
std.Io.Threaded: serenity does not have wait4
2026-04-17 21:32:22 +02:00
Justus Klausecker
a43973b336
std.Io.Semaphore: add waitTimeout
...
Returns `error.Timeout` if provided timeout expires before a permit is available.
Also adds/reworks tests for all wait functions.
2026-04-17 19:19:02 +02:00
Andrew Kelley
c0763b5e25
std.Io.Condition: separate wait impls for clarity
...
also:
* add docs
* add test coverage for waitUncancelable
* explicit error set declaration WaitTimeoutError
2026-04-16 14:52:48 -07:00
Andrew Kelley
078185a54b
std.Io: still run Condition test on single-threaded
...
this will still work under Evented for example
2026-04-16 13:59:40 -07:00
Lukas Lalinsky
d821446cf9
Implement Condition.waitTimeout
...
I'd have preferred if `vtable.futexWait` returned `error.Timeout`, since
all the OS-level APIs provide it. However, if I keep the vtable untouched,
I had to determine the timeout case by post-checking the deadline.
It's fine functionally, but one extra syscall that be avoided at
cost of changing the vtable and all the futex implementations.
2026-04-16 13:37:23 -07:00
Andrew Kelley
a8226cd536
Merge pull request 'Haiku fixes' ( #31851 ) from ypsvlq/zig:master into master
...
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31851
Reviewed-by: Andrew Kelley <andrew@ziglang.org >
2026-04-16 22:18:58 +02:00
xeondev
2b48f559f4
std.Io: move netRead to become an Operation
2026-04-16 22:13:29 +02:00
Andrew Kelley
d092c752f3
std.Io.Writer.print: fix wrong fn signature in docs
...
closes #25963
2026-04-16 10:07:22 -07:00
Alex Rønne Petersen
67023fc4bd
std.os.linux: fix syscall argument width for mipsn32 and x32
...
This required a thorough audit of every syscall wrapper in std.os.linux, so
while I was here, I fixed some minor arch-specific bugs, improved some types,
simplified some casts, and deleted some dead code.
Note that lseek() in particular is still broken for n32 and x32 after this
commit; this wrapper will require some special-casing in the arch bits due to
its unusual return type width.
closes https://github.com/ziglang/zig/issues/22464
closes https://codeberg.org/ziglang/zig/issues/31597
2026-04-16 16:00:21 +02:00
Andrew Kelley
0dd99c37cc
std.Io.Writer.print: update doc comments
...
notably, removes incorrect mention of {D} format specifier
2026-04-15 16:40:19 -07:00
Elaine Gibson
52c000c247
std.Io.Threaded: handle haiku syscall returns correctly
2026-04-14 20:44:00 +01:00
Elaine Gibson
e8a683a0f9
std.Io.Threaded: implement dirReadHaiku
2026-04-14 19:00:57 +01:00
Elaine Gibson
c94ea1ea2d
std.Io.Threaded: haiku fixes
2026-04-14 12:04:41 +01:00
Carl Åstholm
81be7f62ec
Fix debug I/O color detection for most targets
...
On POSIX, start.zig did not reset the `environ_initialized` field, which
prevented the environment variables from ever actually getting scanned.
On Windows, environment variable scanning is allocation-free, so it's
okay for `std.Io.Threaded.init_single_threaded` to use the global
environment block.
2026-04-11 12:28:24 -07:00
Carl Åstholm
3223d3a1ac
Improve debug I/O color detection/handling for WASI and Emscripten
...
When linking libc, these targets can get their environment variables
from `std.c.environ`. Additionally, it's okay for WASI to use ANSI
escape sequences; nothing in the relevant specs claim otherwise.
2026-04-11 12:25:22 -07:00
Alex Rønne Petersen
fa9caeba1b
std.Io.net.test: disable listen on a port, send bytes, receive bytes
...
Still happens: https://codeberg.org/ziglang/zig/issues/31388#issuecomment-12968295
2026-04-11 06:50:53 +02:00
Alex Rønne Petersen
d6f43caadf
Merge pull request 'audit: handle process.Child.Term exhaustively and give useful exit information on process exit' ( #31018 ) from murtaza/zig:child.term-audit into master
...
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31018
Reviewed-by: Alex Rønne Petersen <alex@alexrp.com >
2026-04-11 00:59:11 +02:00
Andrew Kelley
5ccfeb9268
std.Io.net: add error.PortUnreachable to NetReceive
...
closes #31787
2026-04-08 22:58:22 +02:00
Ryan Liptak
cf0f6dd17f
Io.Threaded: Reduce dirRealPathFileWindows stack usage by 64KiB
...
This effectively reinstates the changes made in https://github.com/ziglang/zig/pull/23657 that were lost in the transition to std.Io
2026-04-08 14:30:28 +02:00
murtaza
4a1383d987
process.Child: use std.posix.SIG instead of u32 for Child.Term stopped field
2026-04-07 10:27:21 +02:00
glowsquid
fd2718f82a
fix positional reader discarding ( #31593 )
...
closes #30151
closes #30126
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31593
Reviewed-by: Ryan Liptak <squeek502@noreply.codeberg.org >
Co-authored-by: glowsquid <sachabarsayuracko@gmail.com >
Co-committed-by: glowsquid <sachabarsayuracko@gmail.com >
2026-04-06 02:03:11 +02:00
Andrew Kelley
9292ded5a3
std.Io.Batch: fix add function
...
closes #31730
closes #31757
2026-04-05 02:17:53 -07:00
nektro
e73257dec2
lib/std: BitSet,EnumSet: replace initEmpty/initFull with decl literals ( #31469 )
...
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31469
Reviewed-by: Andrew Kelley <andrew@ziglang.org >
Co-authored-by: nektro <hello@nektro.net >
Co-committed-by: nektro <hello@nektro.net >
2026-04-05 05:12:13 +02:00
Jonathan Marler
f4eecf8d7d
handle EROFS in create/open file
...
I hit an unexpected errno 30 on macos attempting to call createFile on a
directory in PATH. errno 30 is EROFS, this change propagates that error
as error.ReadOnlyFileSystem.
2026-04-02 15:05:31 +02:00