1966 Commits

Author SHA1 Message Date
Andrew Kelley cf65d4f080 Merge pull request 'Fix uefi (un)installMultipleProtocolInterfaces' (#31934) from mrosowski/zig:uefi-fix-install-multiple into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31934
Reviewed-by: linus <mail@linusgroh.de>
2026-04-20 22:39:46 +02:00
Carl Åstholm 2eda0ef8f0 Correct std.os.emscripten.W.STOPSIG return type 2026-04-16 12:34:49 +02:00
David Gonzalez Martin 37a20d3984 Allow the user to override unexpected error trace
This is the only bit left in the standard library where stack trace writing
code is pulled to the binary even if the user doesn't want it
2026-04-13 19:58:01 +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
Carl Åstholm e2a6c74c9a Remove Emscripten stack protector exports
Emscripten already supports SSP and exports the relevant
symbols since version 3.1.64 (2024-07-22).
2026-04-07 22:20:04 +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
Brandon Black bb9f97e085 std.os.linux: add set_tid_address 2026-03-31 14:47:22 -05:00
Alex Rønne Petersen 558a5c7913 std.c: audit some time types for non-Linux OSs
Some initial work towards https://codeberg.org/ziglang/zig/issues/31414.

Conclusion from this: Only x86-freebsd, x86-haiku, and x86-illumos remain time32
and are currently unfixable. I don't think the upstreams for any of these
targets actually care about them anymore (probably why they weren't migrated to
time64), so this is not a particularly big concern.

I split UTIME constants out from timespec because they were causing unreasonable
code duplication by being there.
2026-03-24 09:42:32 +01:00
Jacob Young 83c7aba127 windows: trigger automatic fetching of root certificates 2026-03-20 19:23:48 +01:00
Jacob Young 3c8b96df6d windows: use enums for boolean types 2026-03-20 02:25:16 +01:00
Alex Rønne Petersen 30de1678a6 Merge pull request 'basic loongarch32-linux support' (#31587) from alexrp/zig:loongarch32 into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31587
2026-03-20 02:04:25 +01:00
Alex Rønne Petersen a62d8e3323 std.os.linux: add loongarch32 arch bits
closes https://codeberg.org/ziglang/zig/issues/30948
2026-03-19 19:53:03 +01:00
Jacob Young 9ac1386c10 std.Io.Threaded: windows networking without ws2_32 2026-03-18 20:13:59 -04:00
inf c38e6ed686 feat: remove kernel32.CreateThread, implement ntdll.NtCreateThreadEx inside WindowsThreadImpl (#31519)
Co-authored-by: Ryan Liptak <squeek502@hotmail.com>
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31519
Reviewed-by: Ryan Liptak <squeek502@noreply.codeberg.org>
Co-authored-by: inf <infirms@protonmail.com>
Co-committed-by: inf <infirms@protonmail.com>
2026-03-17 23:06:55 +01:00
Andrew Kelley d6402955d9 kernel32: another one bytes the dust 2026-03-14 06:06:03 +01:00
Matthew Lugg 5d71e30518 std: remove another kernel32 dependency
We can directly access this path string from the PEB (albeit with some
weirdness around addressing) and that ends up making the downstream code
simpler and more efficient. (Almost like the kernel32 API isn't very
good!)
2026-03-13 20:56:00 +01:00
Pablo Alessandro Santos Hugen 627f03af9d std.os.linux: add explicit backing type to packed structs in extern types 2026-03-12 22:33:03 +01:00
kanpura eff332fd04 std.os.uefi.protocol: do not reference errors via the error set(uefi.Status.Error)
closes #31456
2026-03-12 15:19:29 +01:00
Andrew Kelley 3069917384 std.Io.Threaded: use AlertableSyscall for ws2_32 operations
closes #30865
2026-03-11 22:46:13 +01:00
Matthew Lugg d462794e20 get the compiler building
The change in codegen/x86_64/CodeGen.zig was not strictly necessary (the
Sema change I did solves the error I was getting there), I just think
it's better style anyway.
2026-03-10 10:26:13 +00:00
Matthew Lugg 792830d69c std: work around language changes 2026-03-10 10:26:07 +00:00
Andrew Kelley c2ebbd8911 std.Io.Threaded: implement net_receive for Windows 2026-03-08 19:20:06 -07:00
Ryan Liptak fdde8e6394 Delete advapi32 bindings 2026-03-03 01:12:48 -08:00
Ryan Liptak 70058471e3 WindowsSdk: Use ntdll instead of advapi32 APIs for registry querying
The dependency on advapi32.dll actually silently brings along 3 other dlls at runtime (msvcrt.dll, sechost.dll, bcrypt.dll), even if no advapi32 APIs are called. So, this commit actually reduces the number of dlls loaded at runtime by 4 (but only when LLVM is not linked, since LLVM has its own dependency on advapi32.dll).

The data is not super conclusive, but the ntdll version of WindowsSdk appears to run slightly faster than the previous advapi32 version:

Benchmark 1: libc-ntdll.exe ..
  Time (mean ± σ):       6.0 ms ±   0.6 ms    [User: 3.9 ms, System: 7.1 ms]
  Range (min … max):     4.8 ms …   7.9 ms    112 runs

Benchmark 2: libc-advapi32.exe ..
  Time (mean ± σ):       7.2 ms ±   0.5 ms    [User: 5.4 ms, System: 9.2 ms]
  Range (min … max):     6.1 ms …   8.9 ms    103 runs

Summary
  'libc-ntdll.exe ..' ran
    1.21 ± 0.15 times faster than 'libc-advapi32.exe ..'

and this mostly seems to be due to changes in the implementation (the advapi32 APIs do a lot of NtQueryKey calls that the new implementation doesn't do) rather than due to the decrease in dll loading. LLVM-less zig binaries don't show the same reduction (the only difference here is the DLLs being loaded):

Benchmark 1: stage4-ntdll\bin\zig.exe version
  Time (mean ± σ):       3.0 ms ±   0.6 ms    [User: 5.3 ms, System: 4.8 ms]
  Range (min … max):     1.3 ms …   4.2 ms    112 runs

Benchmark 2: stage4-advapi32\bin\zig.exe version
  Time (mean ± σ):       3.5 ms ±   0.6 ms    [User: 6.9 ms, System: 5.5 ms]
  Range (min … max):     2.5 ms …   5.9 ms    111 runs

Summary
  'stage4-ntdll\bin\zig.exe version' ran
    1.16 ± 0.28 times faster than 'stage4-advapi32\bin\zig.exe version'

---

With the removal of the advapi32 dependency, the non-ntdll dependencies that remain in an LLVM-less Zig binary are ws2_32.dll (which brings along rpcrt4.dll at runtime), kernel32.dll (which brings along kernelbase.dll at runtime), and crypt32.dll (which brings along ucrtbase.dll at runtime).
2026-03-03 01:12:47 -08:00
George Huebner 27ef6e9a9b bpf: add missing helpers 2026-02-23 02:27:13 +01:00
Yusuf Bham de6c0d500f uefi(guid): don't use @byteSwap in fmt, adjust fmt test
@byteSwap shouldn't be called since we're formatting
ints again, and UEFI only officially supports LE.
2026-02-22 23:13:33 +01:00
inge4pres 29e52aa040 lib: add cgroup BPF helpers
Add bpf_cgrp_storage_get and bpf_cgrp_storage_delete from
libbpf helpers.

Signed-off-by: inge4pres <fgualazzi@gmail.com>
2026-02-22 20:24:51 +01:00
Alex Rønne Petersen e95132476d std.os.linux: fix the mmap2 unit for various architectures
closes https://codeberg.org/ziglang/zig/issues/31033
2026-02-20 04:56:07 +01:00
Yusuf Bham 1e26d885d3 uefi(guid): don't use std.mem.asBytes in format
Using std.mem.asBytes causes a panic when format
is called as slices can no longer have hex options
when formatting, so instead just print the ints.
2026-02-18 20:19:50 -05:00
Jacob Young 5763f7dbcc std.Io.Evented: clean up supporting code for select 2026-02-15 05:52:07 -05:00
Andrew Kelley 6ccabbd4e5 std: brk allocator for single-threaded mode 2026-02-12 13:14:51 -08:00
Andrew Kelley b600b6e5e0 std.posix: remove close function 2026-02-11 23:37:31 +01:00
Andrew Kelley 7fbeeca924 Merge pull request 'Linux 6.19' (#31165) from alexrp/zig:linux-6.19 into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31165
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-02-10 05:29:00 +01:00
Alex Rønne Petersen 80db2e0b8b std.os.linux: update syscalls for 6.19 2026-02-09 23:54:30 +01:00
Jacob Young a28d57292f IoUring: update to new Io APIs 2026-02-09 10:47:21 -05:00
Ben Buhse 52a6242443 std.os.linux: add F_SEAL constants to F struct
Add the missing F_SEAL_SEAL, F_SEAL_SHRINK, F_SEAL_GROW, F_SEAL_WRITE,
F_SEAL_FUTURE_WRITE, and F_SEAL_EXEC constants used with
F.ADD_SEALS/F.GET_SEALS for memfd file sealing. These are defined in the
Linux kernel at include/uapi/linux/fcntl.h.

The FreeBSD equivalents already exist in std.c (freebsd.F),
but the Linux side was missing them.
2026-02-08 02:11:20 +01:00
Jacob Young b5bd494606 std.Threaded: replace more kernel32 functions with ntdll 2026-02-07 00:02:50 -05:00
brickmonster c38f9336a3 std.os.linux: fix test not building 2026-02-05 21:15:54 +01:00
Jacob Young c77e7146f5 std.Threaded: replace console kernel32 functions with ntdll 2026-02-05 07:41:25 -05:00
Andrew Kelley 3a5fff45ec std: move os.windows.OpenFile into Io.Threaded
it needs cancelation integration
2026-02-04 16:30:17 -08:00
Andrew Kelley 2a193a3987 std: move GetFinalPathNameByHandle to Io.Threaded
unfortunately this function calls NtCreateFile so it has to participate
in cancelation
2026-02-04 16:27:13 -08:00
Jacob Young 71156aff80 std.Progress: implement ipc resource cleanup 2026-02-04 15:20:10 -05:00
Jacob Young ffc6da29e3 std.Io.Threaded: implement and cleanup windows codepaths 2026-02-04 14:15:41 -05:00
Andrew Kelley 922ab8b8bc std: finish moving time to Io interface
Importantly, adds ability to get Clock resolution, which may be zero.
This allows error.Unexpected and error.ClockUnsupported to be removed
from timeout and clock reading error sets.
2026-02-02 23:02:31 -08:00
Krzysztof Antonowski 1cd3af43fd std.Io.Threaded: implement CPU-based clocks on Windows (#31093)
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31093
Co-authored-by: Krzysztof Antonowski <krzysztofantonowski@proton.me>
Co-committed-by: Krzysztof Antonowski <krzysztofantonowski@proton.me>
2026-02-02 22:19:19 +01:00
Andrew Kelley 2b19134c86 Merge pull request 'std.Io: introduce batching and operations API, satisfying the "poll" use case' (#30743) from poll into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30743
2026-01-31 12:07:31 +01:00
Andrew Kelley 5ccc2ea85d std: IoUring test handles EINTR 2026-01-31 09:36:40 +01:00
Andrew Kelley 14e1e5f6d8 std: IoUring test handles EINTR 2026-01-30 22:03:44 -08:00
Andrew Kelley 25aef0dd87 std.Io.Threaded: rework file reading to observe nonblocking flag
- batchAwaitAsync does blocking reads with NtReadFile (no APC, no event)
  when the nonblocking flag is unset, but still takes advantage of
  APCs when nonblocking flag is set.
- batchAwaitConcurrent returns error.ConcurrencyUnavailable when it
  encounters a file_read_streaming operation on a file in blocking mode.
- fileReadStreaming avoids pointlessly checking sync cancelation status
  when nonblocking flag is set, uses an APC with a done flag, and waits
  on that value to change in NtDelayExecution before returning.
- fix incorrect use of NtCancelIoFile (ntdll function prototype was
  wrong, leading to misuse)
2026-01-30 22:03:14 -08:00
Andrew Kelley 866ee4f1c5 std.Io.Threaded: handle TIMEOUT from NtDelayExceution 2026-01-30 22:03:14 -08:00