ziglang/zig
262
5.9k
Fork
You've already forked zig
757

Typed Syscall flags #31772

Closed
bernardassan wants to merge 3 commits from bernardassan/zig:typed-syscall-flags into master
pull from: bernardassan/zig:typed-syscall-flags
merge into: ziglang:master
ziglang:master
ziglang:elfv2
ziglang:spork8
ziglang:restricted
ziglang:0.16.x
ziglang:panic-rewrite
ziglang:parking-futex-lockfree
ziglang:windows-Io-cleanup
ziglang:Io-watch
ziglang:ParseCommandLineOptions
ziglang:windows-async-files
ziglang:poll-ring
ziglang:debug-file-leaks-differently
ziglang:debug-file-leaks
ziglang:ProcessPrng
ziglang:elfv2-dyn
ziglang:jobserver
ziglang:threadtheft
ziglang:io-threaded-no-queue
ziglang:0.15.x
ziglang:Io.net
ziglang:comptime-allocator
ziglang:restricted-function-pointers
ziglang:cli
ziglang:wasm-linker-writer
ziglang:wrangle-writer-buffering
ziglang:sha1-stream
ziglang:async-await-demo
ziglang:fixes
ziglang:0.14.x
ziglang:ast-node-methods
ziglang:macos-debug-info
ziglang:make-vs-configure
ziglang:fuzz-macos
ziglang:sans-aro
ziglang:ArrayList-reserve
ziglang:incr-bug
ziglang:llvm-ir-nosanitize-metadata
ziglang:ci-tarballs
ziglang:ci-scripts
ziglang:threadpool
ziglang:0.12.x
ziglang:new-pkg-hash
ziglang:json-diagnostics
ziglang:more-doctests
ziglang:rework-comptime-mutation
ziglang:0.11.x
ziglang:ci-perf-comment
ziglang:stage2-async
ziglang:0.10.x
ziglang:autofix
ziglang:0.9.x
ziglang:aro
ziglang:hcs
ziglang:0.8.x
ziglang:0.7.x
First-time contributor
Copy link

Improve typesafety of Zig & C syscall flags

This PR is a rework/split of some of my changes from #30067 that were focused on system flags

The plan is to have the General flags changes separated from the IoUring
specific changes, reducing the change set, and making it easy to review

let futex_* syscalls take a pointer to atomic u32
Add typings for AT, W, AF, PF SOCK, MSG, SHUT, and use them where appropriate
Make SOL, SO, IPPROTO typed enums.

The setsockopt syscall is a beast. I tried teaming it with the below
signature to make it more intuitive in Zig, but I have decided to back
out for now and thoroughly think through it before making a PR for that.
My first idea using Io.Threaded's setSocketOption was something like

pubfnsetSocketOption(fd:i32,level:union(enum){sock:posix.SOL,ip:posix.IPPROTO,ipv6:posix.IPPROTO,tcp:posix.IPPROTO,protocal:i32,},opt_name:union(enum){sock:posix.SO,ip:posix.IP,ipv6:posix.IPV6,tcp:posix.TCP,option:u32,},opt_val:u32,)

Namespace Mask in Statx

Fix PF definition for Dragonfly

Add Pipe2 flags for pipe2 syscall

Update C & Zig APIs to use these flags

Remove unnecessary @as coercion and properly format some syscalls

Improve futex2 api and add a Futex2 flag type

socketcall needs a slice of u32s not usize

Add EpollOp enum for epoll operations

Make EPOLL at packed struct

make sa_family_t an AF type

FIX STATX_ATTR not matching the linux kernel github.com/torvalds/linux@bfe62a4545/include/uapi/linux/stat.h (L248)

Move statx_timestamp into Statx namespace

Make MADV and POSIX_FADV typed flags

Cleanup linux/test.zig after the above changes

use fd_t and pid_t over i32 as they are more descriptive

Make FALLOC a typed flag

Bandage IoUring/test so that it passes with the current changes

fix skipKernelLessThan fn to work on WSL Linux

Fix all remaining compile errors and failing tests

Use @hasField over @hasDecl where appropriate

Implement typed SOCK type for all Zig supported platforms

(Note: Haiku https://github.com/haiku/haiku/blob/master/headers/posix/sys/socket.h#L44 actually support socket flags unlike is stated in Io.Threaded implementation)

Get zig build test -Dskip-release -Dskip-non-native passing

Fix issues caught by the above command

Also all std test is already passing

❯ zig build test-std -Dno-matrix --summary all
Build Summary: 3/3 steps succeeded; 3138/3173 tests passed (35 skipped)
test-std success
└─ run test std-native-raptorlake-Debug 3138 pass, 35 skip (3173 total) 20s MaxRSS:160M
 └─ compile test Debug native success 23s MaxRSS:881M

One failing test, but it is unrelated to the PR

❯ zig build test -Dskip-release -Dskip-non-native --summary line
test
└─ test-standalone
 └─ standalone_test_cases
 └─ standalone_test_cases.coff_dwarf
 └─ run exe main failure
error: process exited with code 53 (expected exited with code 0)
failed command: PATH=/home/ultracode/.config/carapace/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/home/ultracode/.local/bin:/usr/lib/helix:.zig-cache/o/70cf46fdd7b97320434d99be45adab0f ./.zig-cache/o/f01000c9e497dc8918e1e87d574d578e/main.exe
Build Summary: 4929/5076 steps succeeded (142 skipped, 1 failed); 16113/16333 tests passed (220 skipped)
error: the following build command failed with exit code 1:
Improve typesafety of Zig & C syscall flags This PR is a rework/split of some of my changes from #30067 that were focused on system flags The plan is to have the General flags changes separated from the IoUring specific changes, reducing the change set, and making it easy to review let futex_* syscalls take a pointer to atomic u32 Add typings for AT, W, AF, PF SOCK, MSG, SHUT, and use them where appropriate Make SOL, SO, IPPROTO typed enums. The setsockopt syscall is a beast. I tried teaming it with the below signature to make it more intuitive in Zig, but I have decided to back out for now and thoroughly think through it before making a PR for that. My first idea using Io.Threaded's `setSocketOption` was something like ```Zig pub fn setSocketOption( fd: i32, level: union(enum) { sock: posix.SOL, ip: posix.IPPROTO, ipv6: posix.IPPROTO, tcp: posix.IPPROTO, protocal: i32, }, opt_name: union(enum) { sock: posix.SO, ip: posix.IP, ipv6: posix.IPV6, tcp: posix.TCP, option: u32, }, opt_val: u32, ) ``` Namespace Mask in Statx Fix PF definition for Dragonfly Add Pipe2 flags for pipe2 syscall Update C & Zig APIs to use these flags Remove unnecessary @as coercion and properly format some syscalls Improve futex2 api and add a Futex2 flag type socketcall needs a slice of u32s not usize Add EpollOp enum for epoll operations Make EPOLL at packed struct make sa_family_t an AF type FIX STATX_ATTR not matching the linux kernel https://github.com/torvalds/linux/blob/bfe62a454542cfad3379f6ef5680b125f41e20f4/include/uapi/linux/stat.h#L248 Move statx_timestamp into Statx namespace Make MADV and POSIX_FADV typed flags Cleanup linux/test.zig after the above changes use fd_t and pid_t over i32 as they are more descriptive Make FALLOC a typed flag Bandage IoUring/test so that it passes with the current changes fix `skipKernelLessThan` fn to work on WSL Linux Fix all remaining compile errors and failing tests Use @hasField over @hasDecl where appropriate Implement typed SOCK type for all Zig supported platforms (Note: Haiku https://github.com/haiku/haiku/blob/master/headers/posix/sys/socket.h#L44 actually support socket flags unlike is stated in Io.Threaded implementation) Get zig build test -Dskip-release -Dskip-non-native passing Fix issues caught by the above command Also all std test is already passing ```elvish ❯ zig build test-std -Dno-matrix --summary all Build Summary: 3/3 steps succeeded; 3138/3173 tests passed (35 skipped) test-std success └─ run test std-native-raptorlake-Debug 3138 pass, 35 skip (3173 total) 20s MaxRSS:160M └─ compile test Debug native success 23s MaxRSS:881M ``` One failing test, but it is unrelated to the PR ```elvish ❯ zig build test -Dskip-release -Dskip-non-native --summary line test └─ test-standalone └─ standalone_test_cases └─ standalone_test_cases.coff_dwarf └─ run exe main failure error: process exited with code 53 (expected exited with code 0) failed command: PATH=/home/ultracode/.config/carapace/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/home/ultracode/.local/bin:/usr/lib/helix:.zig-cache/o/70cf46fdd7b97320434d99be45adab0f ./.zig-cache/o/f01000c9e497dc8918e1e87d574d578e/main.exe Build Summary: 4929/5076 steps succeeded (142 skipped, 1 failed); 16113/16333 tests passed (220 skipped) error: the following build command failed with exit code 1: ```
Author
First-time contributor
Copy link

@andrewrk, I noticed a few issues that I didn't want to include in this issue, as it would be a functional change and not a structural change

This should be set to 1 instead, right

trysetSocketOptionPosix(socket_fd,@intFromEnum(posix.IPPROTO.IPV6),posix.IPV6.V6ONLY,0);

And Haiku has SOCK flags github.com/haiku/haiku@734225977f/headers/posix/sys/socket.h (L50) but here

pubconstsocket_flags_unsupported=is_darwinornative_os==.haiku;

it says other wise. I know most of the Haiku code in Io.Threaded are marked as TODO but I wanted to bring this to your attention.

@andrewrk, I noticed a few issues that I didn't want to include in this issue, as it would be a functional change and not a structural change This should be set to `1` instead, right https://codeberg.org/bernardassan/zig/src/commit/d555389d6b54e2f49165be3cc1bd9803bbb4c8fe/lib/std/Io/Threaded.zig#L12327 And Haiku has SOCK flags https://github.com/haiku/haiku/blob/734225977f3b4b2148bc5d94f3b82db5f4899c11/headers/posix/sys/socket.h#L50 but here https://codeberg.org/bernardassan/zig/src/commit/d555389d6b54e2f49165be3cc1bd9803bbb4c8fe/lib/std/Io/Threaded.zig#L1963 it says other wise. I know most of the Haiku code in `Io.Threaded` are marked as `TODO` but I wanted to bring this to your attention.
bernardassan force-pushed typed-syscall-flags from 5b5ef6afa3
Some checks failed
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / x86_64-netbsd-release (pull_request) Failing after 3m19s
ci / x86_64-freebsd-release (pull_request) Failing after 3m35s
ci / x86_64-openbsd-release (pull_request) Failing after 4m32s
ci / x86_64-netbsd-debug (pull_request) Failing after 4m43s
ci / x86_64-freebsd-debug (pull_request) Failing after 5m27s
ci / x86_64-openbsd-debug (pull_request) Failing after 5m42s
ci / x86_64-linux-debug (pull_request) Failing after 1h7m23s
ci / aarch64-macos-release (pull_request) Successful in 1h12m26s
ci / x86_64-windows-release (pull_request) Successful in 1h18m26s
ci / powerpc64le-linux-release (pull_request) Successful in 1h28m58s
ci / x86_64-windows-debug (pull_request) Successful in 1h38m42s
ci / aarch64-macos-debug (pull_request) Successful in 1h42m16s
ci / aarch64-linux-release (pull_request) Successful in 1h42m38s
ci / x86_64-linux-release (pull_request) Failing after 1h55m18s
ci / loongarch64-linux-release (pull_request) Failing after 1h21m26s
ci / aarch64-freebsd-debug (pull_request) Failing after 14m26s
ci / aarch64-linux-debug (pull_request) Successful in 2h35m14s
ci / aarch64-freebsd-release (pull_request) Failing after 13m22s
ci / x86_64-linux-debug-llvm (pull_request) Failing after 3h30m38s
ci / s390x-linux-release (pull_request) Successful in 3h13m26s
ci / aarch64-netbsd-debug (pull_request) Failing after 22m16s
ci / aarch64-netbsd-release (pull_request) Failing after 18m29s
ci / powerpc64le-linux-debug (pull_request) Successful in 4h59m6s
ci / loongarch64-linux-debug (pull_request) Successful in 3h53m16s
ci / s390x-linux-debug (pull_request) Successful in 5h10m39s
to 85a7db7b81
Some checks failed
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / x86_64-freebsd-release (pull_request) Failing after 2m15s
ci / aarch64-macos-release (pull_request) Failing after 2m11s
ci / aarch64-macos-debug (pull_request) Failing after 2m43s
ci / x86_64-freebsd-debug (pull_request) Failing after 3m2s
ci / x86_64-netbsd-release (pull_request) Failing after 3m15s
ci / x86_64-netbsd-debug (pull_request) Failing after 3m32s
ci / x86_64-openbsd-release (pull_request) Failing after 4m1s
ci / x86_64-openbsd-debug (pull_request) Failing after 5m11s
ci / x86_64-windows-release (pull_request) Failing after 39m57s
ci / x86_64-linux-debug (pull_request) Failing after 51m10s
ci / s390x-linux-release (pull_request) Has been cancelled
ci / aarch64-linux-release (pull_request) Has been cancelled
ci / aarch64-linux-debug (pull_request) Has been cancelled
ci / x86_64-windows-debug (pull_request) Has been cancelled
ci / x86_64-linux-release (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / x86_64-linux-debug-llvm (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-release (pull_request) Has been cancelled
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
2026年04月07日 11:18:43 +02:00
Compare
bernardassan force-pushed typed-syscall-flags from 85a7db7b81
Some checks failed
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / x86_64-freebsd-release (pull_request) Failing after 2m15s
ci / aarch64-macos-release (pull_request) Failing after 2m11s
ci / aarch64-macos-debug (pull_request) Failing after 2m43s
ci / x86_64-freebsd-debug (pull_request) Failing after 3m2s
ci / x86_64-netbsd-release (pull_request) Failing after 3m15s
ci / x86_64-netbsd-debug (pull_request) Failing after 3m32s
ci / x86_64-openbsd-release (pull_request) Failing after 4m1s
ci / x86_64-openbsd-debug (pull_request) Failing after 5m11s
ci / x86_64-windows-release (pull_request) Failing after 39m57s
ci / x86_64-linux-debug (pull_request) Failing after 51m10s
ci / s390x-linux-release (pull_request) Has been cancelled
ci / aarch64-linux-release (pull_request) Has been cancelled
ci / aarch64-linux-debug (pull_request) Has been cancelled
ci / x86_64-windows-debug (pull_request) Has been cancelled
ci / x86_64-linux-release (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / x86_64-linux-debug-llvm (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-release (pull_request) Has been cancelled
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
to 10f139f482
Some checks failed
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / x86_64-netbsd-release (pull_request) Failing after 3m25s
ci / x86_64-netbsd-debug (pull_request) Failing after 3m48s
ci / x86_64-freebsd-release (pull_request) Successful in 38m48s
ci / aarch64-linux-release (pull_request) Has been cancelled
ci / aarch64-linux-debug (pull_request) Has been cancelled
ci / aarch64-macos-debug (pull_request) Has been cancelled
ci / aarch64-macos-release (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-release (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Has been cancelled
ci / s390x-linux-release (pull_request) Has been cancelled
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / x86_64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / x86_64-linux-debug (pull_request) Has been cancelled
ci / x86_64-linux-debug-llvm (pull_request) Has been cancelled
ci / x86_64-openbsd-debug (pull_request) Has been cancelled
ci / x86_64-linux-release (pull_request) Has been cancelled
ci / x86_64-openbsd-release (pull_request) Has been cancelled
ci / x86_64-windows-debug (pull_request) Has been cancelled
ci / x86_64-windows-release (pull_request) Has been cancelled
2026年04月07日 12:12:46 +02:00
Compare
bernardassan force-pushed typed-syscall-flags from 10f139f482
Some checks failed
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / x86_64-netbsd-release (pull_request) Failing after 3m25s
ci / x86_64-netbsd-debug (pull_request) Failing after 3m48s
ci / x86_64-freebsd-release (pull_request) Successful in 38m48s
ci / aarch64-linux-release (pull_request) Has been cancelled
ci / aarch64-linux-debug (pull_request) Has been cancelled
ci / aarch64-macos-debug (pull_request) Has been cancelled
ci / aarch64-macos-release (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-release (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Has been cancelled
ci / s390x-linux-release (pull_request) Has been cancelled
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / x86_64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / x86_64-linux-debug (pull_request) Has been cancelled
ci / x86_64-linux-debug-llvm (pull_request) Has been cancelled
ci / x86_64-openbsd-debug (pull_request) Has been cancelled
ci / x86_64-linux-release (pull_request) Has been cancelled
ci / x86_64-openbsd-release (pull_request) Has been cancelled
ci / x86_64-windows-debug (pull_request) Has been cancelled
ci / x86_64-windows-release (pull_request) Has been cancelled
to fc0cd9a1bd
Some checks failed
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / x86_64-netbsd-release (pull_request) Failing after 37m5s
ci / x86_64-freebsd-release (pull_request) Successful in 43m52s
ci / x86_64-netbsd-debug (pull_request) Failing after 46m25s
ci / x86_64-linux-debug (pull_request) Successful in 52m37s
ci / x86_64-freebsd-debug (pull_request) Successful in 56m42s
ci / x86_64-openbsd-release (pull_request) Successful in 1h8m30s
ci / powerpc64le-linux-release (pull_request) Failing after 1h11m42s
ci / x86_64-windows-release (pull_request) Successful in 1h13m18s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h15m27s
ci / x86_64-windows-debug (pull_request) Successful in 1h22m13s
ci / s390x-linux-release (pull_request) Successful in 1h28m20s
ci / aarch64-linux-release (pull_request) Successful in 1h31m19s
ci / aarch64-macos-release (pull_request) Successful in 1h41m39s
ci / x86_64-linux-debug-llvm (pull_request) Failing after 1h49m15s
ci / aarch64-macos-debug (pull_request) Successful in 1h58m19s
ci / x86_64-linux-release (pull_request) Failing after 2h38m47s
ci / aarch64-linux-debug (pull_request) Successful in 2h38m59s
ci / s390x-linux-debug (pull_request) Successful in 2h43m47s
ci / loongarch64-linux-release (pull_request) Successful in 2h27m46s
ci / loongarch64-linux-debug (pull_request) Successful in 3h34m53s
ci / powerpc64le-linux-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
2026年04月07日 13:02:10 +02:00
Compare
bernardassan force-pushed typed-syscall-flags from fc0cd9a1bd
Some checks failed
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / x86_64-netbsd-release (pull_request) Failing after 37m5s
ci / x86_64-freebsd-release (pull_request) Successful in 43m52s
ci / x86_64-netbsd-debug (pull_request) Failing after 46m25s
ci / x86_64-linux-debug (pull_request) Successful in 52m37s
ci / x86_64-freebsd-debug (pull_request) Successful in 56m42s
ci / x86_64-openbsd-release (pull_request) Successful in 1h8m30s
ci / powerpc64le-linux-release (pull_request) Failing after 1h11m42s
ci / x86_64-windows-release (pull_request) Successful in 1h13m18s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h15m27s
ci / x86_64-windows-debug (pull_request) Successful in 1h22m13s
ci / s390x-linux-release (pull_request) Successful in 1h28m20s
ci / aarch64-linux-release (pull_request) Successful in 1h31m19s
ci / aarch64-macos-release (pull_request) Successful in 1h41m39s
ci / x86_64-linux-debug-llvm (pull_request) Failing after 1h49m15s
ci / aarch64-macos-debug (pull_request) Successful in 1h58m19s
ci / x86_64-linux-release (pull_request) Failing after 2h38m47s
ci / aarch64-linux-debug (pull_request) Successful in 2h38m59s
ci / s390x-linux-debug (pull_request) Successful in 2h43m47s
ci / loongarch64-linux-release (pull_request) Successful in 2h27m46s
ci / loongarch64-linux-debug (pull_request) Successful in 3h34m53s
ci / powerpc64le-linux-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
to b4ca995398
Some checks failed
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / x86_64-netbsd-release (pull_request) Failing after 28m12s
ci / x86_64-freebsd-release (pull_request) Successful in 34m2s
ci / x86_64-netbsd-debug (pull_request) Failing after 35m16s
ci / x86_64-linux-debug (pull_request) Successful in 42m48s
ci / x86_64-freebsd-debug (pull_request) Successful in 46m46s
ci / x86_64-openbsd-release (pull_request) Successful in 47m51s
ci / x86_64-windows-release (pull_request) Successful in 48m44s
ci / aarch64-macos-release (pull_request) Successful in 56m18s
ci / x86_64-openbsd-debug (pull_request) Successful in 55m58s
ci / aarch64-macos-debug (pull_request) Successful in 1h13m28s
ci / x86_64-windows-debug (pull_request) Successful in 1h14m59s
ci / powerpc64le-linux-release (pull_request) Successful in 1h22m23s
ci / aarch64-linux-release (pull_request) Successful in 1h23m9s
ci / x86_64-linux-release (pull_request) Failing after 1h48m59s
ci / s390x-linux-release (pull_request) Successful in 1h56m41s
ci / loongarch64-linux-release (pull_request) Successful in 2h2m51s
ci / x86_64-linux-debug-llvm (pull_request) Failing after 2h5m33s
ci / aarch64-linux-debug (pull_request) Successful in 2h34m40s
ci / loongarch64-linux-debug (pull_request) Successful in 3h0m22s
ci / s390x-linux-debug (pull_request) Successful in 3h11m52s
ci / powerpc64le-linux-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
2026年04月07日 16:52:53 +02:00
Compare
bernardassan force-pushed typed-syscall-flags from b4ca995398
Some checks failed
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / x86_64-netbsd-release (pull_request) Failing after 28m12s
ci / x86_64-freebsd-release (pull_request) Successful in 34m2s
ci / x86_64-netbsd-debug (pull_request) Failing after 35m16s
ci / x86_64-linux-debug (pull_request) Successful in 42m48s
ci / x86_64-freebsd-debug (pull_request) Successful in 46m46s
ci / x86_64-openbsd-release (pull_request) Successful in 47m51s
ci / x86_64-windows-release (pull_request) Successful in 48m44s
ci / aarch64-macos-release (pull_request) Successful in 56m18s
ci / x86_64-openbsd-debug (pull_request) Successful in 55m58s
ci / aarch64-macos-debug (pull_request) Successful in 1h13m28s
ci / x86_64-windows-debug (pull_request) Successful in 1h14m59s
ci / powerpc64le-linux-release (pull_request) Successful in 1h22m23s
ci / aarch64-linux-release (pull_request) Successful in 1h23m9s
ci / x86_64-linux-release (pull_request) Failing after 1h48m59s
ci / s390x-linux-release (pull_request) Successful in 1h56m41s
ci / loongarch64-linux-release (pull_request) Successful in 2h2m51s
ci / x86_64-linux-debug-llvm (pull_request) Failing after 2h5m33s
ci / aarch64-linux-debug (pull_request) Successful in 2h34m40s
ci / loongarch64-linux-debug (pull_request) Successful in 3h0m22s
ci / s390x-linux-debug (pull_request) Successful in 3h11m52s
ci / powerpc64le-linux-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
to 9f80f4501c
Some checks failed
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / aarch64-macos-release (pull_request) Successful in 34m17s
ci / x86_64-netbsd-release (pull_request) Failing after 39m47s
ci / x86_64-freebsd-release (pull_request) Successful in 44m48s
ci / x86_64-netbsd-debug (pull_request) Failing after 49m26s
ci / x86_64-openbsd-release (pull_request) Successful in 1h9m18s
ci / x86_64-linux-debug (pull_request) Successful in 1h18m43s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h19m5s
ci / x86_64-windows-release (pull_request) Successful in 1h11m49s
ci / x86_64-windows-debug (pull_request) Successful in 1h25m34s
ci / aarch64-linux-release (pull_request) Successful in 1h32m41s
ci / powerpc64le-linux-release (pull_request) Successful in 1h40m0s
ci / aarch64-macos-debug (pull_request) Successful in 1h45m26s
ci / aarch64-linux-debug (pull_request) Successful in 2h31m25s
ci / x86_64-linux-release (pull_request) Successful in 2h51m31s
ci / s390x-linux-release (pull_request) Successful in 3h7m34s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 3h9m1s
ci / loongarch64-linux-release (pull_request) Successful in 2h12m7s
ci / powerpc64le-linux-debug (pull_request) Successful in 4h29m44s
ci / loongarch64-linux-debug (pull_request) Successful in 3h31m25s
ci / s390x-linux-debug (pull_request) Successful in 5h28m1s
ci / x86_64-freebsd-debug (pull_request) Successful in 48m22s
ci / aarch64-freebsd-release (pull_request) Successful in 2h53m38s
ci / aarch64-netbsd-debug (pull_request) Failing after 3h34m6s
ci / aarch64-netbsd-release (pull_request) Failing after 2h25m29s
ci / aarch64-freebsd-debug (pull_request) Successful in 3h52m47s
2026年04月07日 20:34:27 +02:00
Compare
Author
First-time contributor
Copy link

The failing tests on *-netbsd-* are pertaining to stacktraces which seem unrelated to my changes

The failing tests on `*-netbsd-*` are pertaining to stacktraces which seem unrelated to my changes
andrewrk left a comment
Copy link

Thank you for this work, but this is difficult to review from a first-time contributor. Can we start with some more isolated patchsets?

Thank you for this work, but this is difficult to review from a first-time contributor. Can we start with some more isolated patchsets?

@bernardassan wrote in #31772 (comment):

The failing tests on *-netbsd-* are pertaining to stacktraces which seem unrelated to my changes

This seems like a dubious claim considering your patch significantly refactors std.c.W and the failures are due to unexpected exit status.

@bernardassan wrote in https://codeberg.org/ziglang/zig/pulls/31772#issuecomment-12877893: > The failing tests on `*-netbsd-*` are pertaining to stacktraces which seem unrelated to my changes This seems like a dubious claim considering your patch significantly refactors `std.c.W` and the failures are due to unexpected exit status.
Author
First-time contributor
Copy link

Alright @andrewrk, thank you for the review. I will break this down into smaller PRs and submit them in succession.

@alexrp, that doesn't seem like a far-fetched assessment, because I realized other PRs were going full green, so I will start with std.c.W and doubly verify the NetBSD side. Thanks for your feedback.

Alright @andrewrk, thank you for the review. I will break this down into smaller PRs and submit them in succession. @alexrp, that doesn't seem like a far-fetched assessment, because I realized other PRs were going full green, so I will start with `std.c.W` and doubly verify the NetBSD side. Thanks for your feedback.
bernardassan referenced this pull request from a commit 2026年04月09日 14:20:11 +02:00
bernardassan referenced this pull request from a commit 2026年04月09日 16:43:44 +02:00
bernardassan referenced this pull request from a commit 2026年04月14日 17:47:38 +02:00

Closing in anticipation of the smaller successive PRs.

Closing in anticipation of the smaller successive PRs.
andrewrk closed this pull request 2026年04月16日 00:57:11 +02:00
bernardassan referenced this pull request from a commit 2026年04月16日 13:39:52 +02:00
bernardassan referenced this pull request from a commit 2026年04月16日 18:54:18 +02:00
bernardassan referenced this pull request from a commit 2026年05月26日 02:31:19 +02:00
bernardassan referenced this pull request from a commit 2026年06月29日 01:04:10 +02:00
Some checks failed
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / aarch64-macos-release (pull_request) Successful in 34m17s
Required
Details
ci / x86_64-netbsd-release (pull_request) Failing after 39m47s
Required
Details
ci / x86_64-freebsd-release (pull_request) Successful in 44m48s
Required
Details
ci / x86_64-netbsd-debug (pull_request) Failing after 49m26s
Required
Details
ci / x86_64-openbsd-release (pull_request) Successful in 1h9m18s
Required
Details
ci / x86_64-linux-debug (pull_request) Successful in 1h18m43s
Required
Details
ci / x86_64-openbsd-debug (pull_request) Successful in 1h19m5s
Required
Details
ci / x86_64-windows-release (pull_request) Successful in 1h11m49s
Required
Details
ci / x86_64-windows-debug (pull_request) Successful in 1h25m34s
Required
Details
ci / aarch64-linux-release (pull_request) Successful in 1h32m41s
Required
Details
ci / powerpc64le-linux-release (pull_request) Successful in 1h40m0s
Required
Details
ci / aarch64-macos-debug (pull_request) Successful in 1h45m26s
Required
Details
ci / aarch64-linux-debug (pull_request) Successful in 2h31m25s
Required
Details
ci / x86_64-linux-release (pull_request) Successful in 2h51m31s
Required
Details
ci / s390x-linux-release (pull_request) Successful in 3h7m34s
Required
Details
ci / x86_64-linux-debug-llvm (pull_request) Successful in 3h9m1s
Required
Details
ci / loongarch64-linux-release (pull_request) Successful in 2h12m7s
ci / powerpc64le-linux-debug (pull_request) Successful in 4h29m44s
Required
Details
ci / loongarch64-linux-debug (pull_request) Successful in 3h31m25s
ci / s390x-linux-debug (pull_request) Successful in 5h28m1s
Required
Details
ci / x86_64-freebsd-debug (pull_request) Successful in 48m22s
Required
Details
ci / aarch64-freebsd-release (pull_request) Successful in 2h53m38s
ci / aarch64-netbsd-debug (pull_request) Failing after 3h34m6s
ci / aarch64-netbsd-release (pull_request) Failing after 2h25m29s
ci / aarch64-freebsd-debug (pull_request) Successful in 3h52m47s

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No reviewers
Labels
Clear labels
abi/f32
abi/ilp32
abi/sf
accepted
This proposal is planned.
arch/21k
arch/6502
arch/aarch64
arch/alpha
arch/amdgcn
arch/arc
arch/arc32
arch/arc64
arch/arm
arch/avr
arch/bfin
arch/bpf
arch/colossus
arch/cris
arch/csky
arch/dlx
arch/epiphany
arch/fr30
arch/frv
arch/hexagon
arch/hppa
arch/hppa64
arch/ia64
arch/kalimba
arch/kvx
arch/lanai
arch/lm32
arch/loongarch32
arch/loongarch64
arch/m32r
arch/m68k
arch/m88k
arch/mcore
arch/microblaze
arch/mips
arch/mips64
arch/mmix
arch/moxie
arch/mrisc32
arch/msp430
arch/nds32
arch/ns32k
arch/nvptx
arch/or1k
arch/powerpc
arch/powerpc64
arch/propeller
arch/riscv32
arch/riscv64
arch/rl78
arch/rx
arch/s390x
arch/sh
arch/sparc
arch/sparc64
arch/spirv
arch/spu
arch/tricore
arch/v850
arch/vax
arch/vc4
arch/ve
arch/wasm
arch/x86
arch/x86_64
arch/xcore
arch/xtensa
autodoc
The web application for interactive documentation and generation of its assets.
backend/c
The C backend outputs C source code.
backend/llvm
The LLVM backend outputs an LLVM bitcode module.
backend/self-hosted
The self-hosted backends produce machine code directly.
binutils
Zig's included binary utilities: zig ar, zig dlltool, zig lib, zig ranlib, zig objcopy, and zig rc.
breaking
Implementing this issue could cause existing code to no longer compile or have different behavior.
build system
The Zig build system - zig build, std.Build, the build runner, and package management.
debug info
An issue related to debug information (e.g. DWARF) produced by the Zig compiler.
docs
An issue with documentation, e.g. the language reference or standard library doc comments.
error message
This issue points out an error message that is unhelpful and should be improved.
frontend
Tokenization, parsing, AstGen, ZonGen, Sema, Legalize, and Liveness.
fuzzing
An issue related to Zig's integrated fuzz testing.
incremental
Reuse of internal compiler state for faster compilation.
lib/c
This issue relates to Zig's libc implementation and/or vendored libcs.
lib/compiler-rt
This issue relates to Zig's compiler-rt library.
lib/cxx
This issue relates to Zig's vendored libc++ and/or libc++abi.
lib/std
This issue relates to Zig's standard library.
lib/tsan
This issue relates to Zig's vendored libtsan.
lib/ubsan-rt
This issue relates to Zig's ubsan-rt library.
lib/unwind
This issue relates to Zig's vendored libunwind.
linking
Zig's integrated object file and incremental linker.
miscompilation
The compiler reports success but produces semantically incorrect code.
os/android
os/contiki
os/dragonfly
os/driverkit
os/emscripten
os/freebsd
os/fuchsia
os/haiku
os/hermit
os/hurd
os/illumos
os/ios
os/linux
os/maccatalyst
os/macos
os/managarm
os/netbsd
os/ohos
os/openbsd
os/plan9
os/redox
os/rtems
os/serenity
os/tvos
os/uefi
os/visionos
os/wasi
os/watchos
os/windows
proposal
This issue suggests language modifications. If it also has the "accepted" label then it is planned.
release notes
This issue or pull request should be mentioned in the release notes.
testing
This issue is related to testing the compiler, standard library, or other parts of Zig.
zig cc
Zig as a drop-in C-family compiler.
zig fmt
The Zig source code formatter.
zig reduce
The Zig source code reduction tool.
bounty
https://ziglang.org/news/announcing-donor-bounties
bug
Observed behavior contradicts documented or intended behavior.
contributor-friendly
This issue is limited in scope and/or knowledge of project internals.
downstream
An issue with a third-party project that uses this project.
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
infra
An issue related to project infrastructure, e.g. continuous integration.
optimization
A task to improve performance and/or resource usage.
question
No questions on the issue tracker; use a community space instead.
regression
Something that used to work in a previous version stopped working
upstream
An issue with a third-party project that this project uses.
use case
Describes a real use case that is difficult or impossible, but does not propose a solution.
No labels
abi/f32
abi/ilp32
abi/sf
accepted
arch/21k
arch/6502
arch/aarch64
arch/alpha
arch/amdgcn
arch/arc
arch/arc32
arch/arc64
arch/arm
arch/avr
arch/bfin
arch/bpf
arch/colossus
arch/cris
arch/csky
arch/dlx
arch/epiphany
arch/fr30
arch/frv
arch/hexagon
arch/hppa
arch/hppa64
arch/ia64
arch/kalimba
arch/kvx
arch/lanai
arch/lm32
arch/loongarch32
arch/loongarch64
arch/m32r
arch/m68k
arch/m88k
arch/mcore
arch/microblaze
arch/mips
arch/mips64
arch/mmix
arch/moxie
arch/mrisc32
arch/msp430
arch/nds32
arch/ns32k
arch/nvptx
arch/or1k
arch/powerpc
arch/powerpc64
arch/propeller
arch/riscv32
arch/riscv64
arch/rl78
arch/rx
arch/s390x
arch/sh
arch/sparc
arch/sparc64
arch/spirv
arch/spu
arch/tricore
arch/v850
arch/vax
arch/vc4
arch/ve
arch/wasm
arch/x86
arch/x86_64
arch/xcore
arch/xtensa
autodoc
backend/c
backend/llvm
backend/self-hosted
binutils
breaking
build system
debug info
docs
error message
frontend
fuzzing
incremental
lib/c
lib/compiler-rt
lib/cxx
lib/std
lib/tsan
lib/ubsan-rt
lib/unwind
linking
miscompilation
os/android
os/contiki
os/dragonfly
os/driverkit
os/emscripten
os/freebsd
os/fuchsia
os/haiku
os/hermit
os/hurd
os/illumos
os/ios
os/linux
os/maccatalyst
os/macos
os/managarm
os/netbsd
os/ohos
os/openbsd
os/plan9
os/redox
os/rtems
os/serenity
os/tvos
os/uefi
os/visionos
os/wasi
os/watchos
os/windows
proposal
release notes
testing
zig cc
zig fmt
zig reduce
bounty
bug
contributor-friendly
downstream
enhancement
infra
optimization
question
regression
upstream
use case
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ziglang/zig!31772
Reference in a new issue
ziglang/zig
No description provided.
Delete branch "bernardassan/zig:typed-syscall-flags"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?