Commit Graph

14548 Commits

Author SHA1 Message Date
Andrew Kelley 5c42193b17 std.Io.Threaded: rework cancelation
Now it can handle sync cancelation and alertable cancelation on Windows.

Also fix the API of NtCancelIoFileEx
2026-01-23 12:59:36 -08:00
Andrew Kelley 499ba5d55c compiler: use Io.MemoryMap
Also make setLength return error.OperationUnsupported when it cannot be
done atomically.
2026-01-22 21:25:53 -08:00
Andrew Kelley 1badb2a840 std.Io.Threaded: dirCreateFileWindows uses NtCreateFile directly 2026-01-22 18:08:13 -08:00
InKryption 305fd06756 Build: check if dynamic lib installed for symlinks
If the library isn't actually installed, `generated_bin` will be null,
causing this to panic about a missing dependency for itself; checking
for this state avoids this.
2026-01-22 22:28:28 +01:00
bartimaeusnek 37288e53ae std.zig.system.loongarch: implement individual cpu feature bit tests (#30915)
closes #30902

Co-authored-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30915
Reviewed-by: Alex Rønne Petersen <alex@alexrp.com>
Co-authored-by: bartimaeusnek <bartimaeusnek@noreply.codeberg.org>
Co-committed-by: bartimaeusnek <bartimaeusnek@noreply.codeberg.org>
2026-01-22 19:18:47 +01:00
Chadwain Holness fd3657bf8c Io.Threaded: remove WSA_FLAG_OVERLAPPED from socket call 2026-01-22 03:39:00 +01:00
Andrew Kelley 4b2eae32f1 Merge pull request 'libc: use common implementation for sys/utsname.h' (#30904) from GasInfinity/zig:libc-uname into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30904
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-01-22 02:23:52 +01:00
Alex Rønne Petersen 3245eddcb1 musl: fix typo in 171b104640 2026-01-21 17:53:11 +01:00
Alex Rønne Petersen 9f33c339c7 std.fs.test: fix file operations on directories on NetBSD
As noted earlier in this test, reading directories does not fail on NetBSD.
2026-01-21 16:42:02 +01:00
Matthew Lugg 35a191ec1c std.Io.Threaded: fix futex timeout race handling 2026-01-21 16:41:55 +01:00
Alex Rønne Petersen a3ea3bd31d std: NetBSD doesn't have a reliable F_GETPATH
It can fail arbitrarily with ENOENT if the kernel happens to not have the FD in
its name cache. That makes it useless for our purposes.

closes https://codeberg.org/ziglang/zig/issues/30843
2026-01-21 16:41:51 +01:00
Michael Dusan 32f977a4b7 std.fs.test: fix tests using Dir.realPath
* add fn isRealPathSupported
* incorporate into tests that depends on Dir.realPath
2026-01-21 16:41:37 +01:00
Alex Rønne Petersen fc59f0e7f0 std.Io.test: skip atime check in setTimestamps on NetBSD 2026-01-21 16:41:30 +01:00
GasInfinity 1ab6bf59a6 feat(libzigc): add common linux errno syscall helper 2026-01-21 12:02:08 +01:00
Andrew Kelley 7cbe05cbd4 Merge pull request 'std.os.linux: add some missing syscalls' (#30899) from brickmonster/zig:syscalls into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30899
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-01-21 00:28:40 +01:00
GasInfinity 4f652fb4e3 feat(libzigc): use common implementations for sys/utsname.h
* and remove their musl/wasi implementation
2026-01-21 00:06:42 +01:00
GasInfinity 9d3e9054a7 feat(std.c): add wasi definition for utsname 2026-01-21 00:06:42 +01:00
GasInfinity f67d21f736 chore(libc/musl): remove unused ffs impls
* forgot to remove them in the previous PR
2026-01-21 00:06:42 +01:00
brickmonster 8042096bca std.os.linux: add some missing syscalls 2026-01-20 18:30:45 +00:00
rpkak e6ac1b77f0 libzigc: test and fix acos 2026-01-20 18:02:15 +01:00
brickmonster 62ce228b37 std.os.linux: fix some compilation errors 2026-01-20 16:09:49 +00:00
Daggerfall-is-the-best-TES-game 21fc85f035 Add acos to ziglibc (#30888)
Since this is my first time contributing I wanted to keep it simple and I added just one function
I tested with
```bash
stage3/bin/zig build -p stage4 -Dno-lib -Dno-langref -Denable-llvm=true --search-prefix ~/repos/zig-boostrap/out/native-linux-musl-baseline/
stage4/bin/zig build test-libc -Dlibc-test-path=../libc-test -Dtest-target-filter=x86_64-linux-musl
```
and the tests passed.
I'm planning on doing more once I get the hang of it.

Co-authored-by: david <davidc.fried@gmail.com>
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30888
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
Co-authored-by: Daggerfall-is-the-best-TES-game <daggerfall-is-the-best-tes-game@noreply.codeberg.org>
Co-committed-by: Daggerfall-is-the-best-TES-game <daggerfall-is-the-best-tes-game@noreply.codeberg.org>
2026-01-19 22:43:57 +01:00
Alex Rønne Petersen c71d32d14a std.c.netbsd: change type of _ksiginfo.signo to std.c.SIG 2026-01-19 13:16:03 +01:00
Alex Rønne Petersen fb66d7712c std.c: fix W functions for NetBSD
I'm not sure where the old logic came from but it certainly didn't match NetBSD
10.1 system headers, and was causing the build system to see incorrect exit
status information for processes that were expected to crash (e.g. SIGABRT).
2026-01-19 13:15:57 +01:00
jsentity 27e8d05ee8 Fix protocol.DevicePath.next() (#30883)
fix for https://codeberg.org/ziglang/zig/issues/30882

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30883
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
Co-authored-by: jsentity <jsentity@noreply.codeberg.org>
Co-committed-by: jsentity <jsentity@noreply.codeberg.org>
2026-01-18 21:42:34 +01:00
Andrew Kelley d2dda0737b std.Io.Threaded: sendmmsg can return EACCES 2026-01-18 21:40:15 +01:00
GasInfinity d6b3dd25a0 chore(libzigc): document libc target checks 2026-01-18 00:26:42 +01:00
GasInfinity f0649dd978 feat(libzigc): use common implementations for strings.h and string.h
* forwards all functions to their equivalent `std`
* removes their musl, wasi-libc and mingw implementations
2026-01-17 22:37:29 +01:00
GasInfinity 06d05decae feat(libzigc): add wcstok and reuse more std.mem code
* also makes `wcpncpy`/`wcsncpy` pad the buffer with zeroes as required
  by the standard
2026-01-17 21:42:40 +01:00
GasInfinity 3d8b0e3324 feat(std.ascii): add boundedOrderIgnoreCaseZ 2026-01-17 21:42:38 +01:00
GasInfinity 26de7a3513 feat(std.mem): add boundedOrderZ 2026-01-17 21:42:32 +01:00
Alex Rønne Petersen 27685bcf20 std.c: fix O constants for FreeBSD
closes https://codeberg.org/ziglang/zig/issues/30861
2026-01-17 12:13:20 +01:00
Andrew Kelley d417441f4f Merge pull request 'libc: use common implementations for wchar.h' (#30850) from GasInfinity/zig:libc-wchar into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30850
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-01-17 00:58:01 +01:00
murtaza b5770541bd testing: ability to read environment variables from unit tests 2026-01-17 00:40:22 +01:00
Andrew Kelley 790d28d6cd std.testing: delete refAllDeclsRecursive
suggested alternatives:
- actual tests
- explicitly list the decls
- compile an example application that uses the API
- stop worrying about dead code
- refAllDecls (non recursive) in each file

Don't fight the laziness, embrace it.

closes #23608
closes #30813
2026-01-16 12:34:42 -08:00
Alex Rønne Petersen 081888286b musl: patch riscv bits/fenv.h for soft float 2026-01-16 13:29:34 +01:00
Alex Rønne Petersen 171b104640 musl: patch loongarch bits/fenv.h for soft float
This change was missed in 1f7ee99b35.
2026-01-16 13:25:21 +01:00
Alex Rønne Petersen f2beea3b8f std.os.linux.IoUring.test: disable accept_direct on RISC-V
https://codeberg.org/ziglang/zig/issues/30854
2026-01-16 11:40:19 +01:00
GasInfinity e3309aaf4f fix(libzigc): workaround LLVM bug
* looks like we get stuck inside this loop? https://github.com/llvm/llvm-project/blob/2078da43e25a4623cab2d0d60decddf709aaea28/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp#L245-L298
2026-01-16 01:58:35 +01:00
Andrew Kelley 7b21fd7244 std.Io.Threaded: fix memory mapping on windows
- set protection flags properly
- handle when mapping fails after unmapping
2026-01-15 14:18:21 -08:00
Andrew Kelley d2585e68a7 std.Io.Threaded: use NtExtendSection in fileMemoryMapSetLength
is this a good idea? not sure yet. reverting in the next commit
2026-01-15 14:18:21 -08:00
Andrew Kelley de347dd6a9 std.Io.Threaded: add missing free in MemoryMap.setLength 2026-01-15 14:18:21 -08:00
Andrew Kelley 7ff6bcc111 std.Io.Threaded: track unaligned mapping length on Windows 2026-01-15 14:18:21 -08:00
Andrew Kelley b2776d097d std.Io.Threaded: implement MemoryMap.setLength for Windows 2026-01-15 14:18:20 -08:00
Andrew Kelley 8527ec9c7b std.Io.Threaded: implement mmap fallback for Windows 2026-01-15 14:18:20 -08:00
Andrew Kelley 3c708b19fe disable test due to wasmtime bug
tracked by #20747
2026-01-15 14:18:20 -08:00
Andrew Kelley 2b01764d86 std: fix handling of EBADF error code
In the context of read/write it's ambiguous, means file was opened
without read/write respectively.
2026-01-15 14:18:20 -08:00
Andrew Kelley cb37a5c1fb std.Io.Threaded: fix fileReadPositional error.IsDir for wasi 2026-01-15 14:18:20 -08:00
Andrew Kelley 08a33c0671 std: workaround for #30842 2026-01-15 14:18:20 -08:00
Andrew Kelley c4df980ac2 std.fs: fix test cases regarding error.IsDir on WASI
why were we testing for shitty behavior?
2026-01-15 14:18:20 -08:00