Commit Graph

36675 Commits

Author SHA1 Message Date
Andrew Kelley b0570b807f Merge pull request 'std.Io.Threaded: clock_nanosleep is not linux-only' (#30746) from clock_nanosleep into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30746
2026-01-08 21:00:36 +01:00
Andrew Kelley 1face9ad78 std.c.SIG: make it non-exhaustive
54a84964f8 did this for std.os.linux.SIG
but I neglected to also do it for std.c.SIG
2026-01-08 20:52:42 +01:00
Alex Rønne Petersen d1be8b138e Merge pull request 'enable x86_64-openbsd CI' (#30733) from alexrp/zig:openbsd-ci into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30733
2026-01-08 12:35:11 +01:00
Ian Johnson ac91799332 std.meta.hasUniqueRepresentation: consider enum tag type
Closes #30731
2026-01-08 09:24:12 +01:00
Andrew Kelley 6f7968f165 Merge branch "remove many std.posix functions"
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30741
2026-01-08 00:19:12 -08:00
Alex Rønne Petersen cc38acfea3 ci: skip incremental tests on loongarch64-linux
https://codeberg.org/ziglang/zig/issues/30748
2026-01-08 07:01:57 +01:00
Andrew Kelley 130fc7ef75 std.c: use {} rather than void for absent functions 2026-01-07 21:13:16 -08:00
Andrew Kelley 4319c8924e std.Io.Threaded: clock_nanosleep is not linux-only
clock_nanosleep is specified by POSIX but not implemented on these
hereby shamed operating systems:
* macOS
* OpenBSD (which defines TIMER_ABSTIME for some reason...?)
2026-01-07 21:13:16 -08:00
moriazoso 514b103edb std.Io.Threaded: correctly initialize PosixAddress/WsaAddress from sockaddr (#30722)
Resolves ziglang/zig#30672 - UB caused by `std.Io.Threaded.netLookupFallible` incorrectly initializing `PosixAddress`/`WsaAddress` from `*sockaddr`.

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30722
Co-authored-by: moriazoso <greysonmurray.dev@gmail.com>
Co-committed-by: moriazoso <greysonmurray.dev@gmail.com>
2026-01-08 06:01:44 +01:00
Andrew Kelley 6a5bb3ede3 std: find a better home for the "preopens" concept 2026-01-08 05:06:31 +01:00
pentuppup d2d8b969a1 fix redundant safety checks being emitted for slicing 2026-01-08 05:05:39 +01:00
Bingwu Zhang cdaf279314 link.Elf2: fix incorrect expected node length
Change-Id: Iba9c4bf2cfa4ff1b82dd5f0828c57711f238f1bf
2026-01-08 04:54:49 +01:00
Bingwu Zhang 8d06d8dca2 link.Elf: allow multiple relocs at the same location
RISC-V and LoongArch ELF psABIs define a kind of
RELAX relocations which are expected to have a normal
relocation at the same address.

Change-Id: I5737bfcfd3e5041fb6ab7d193c9fc57eeca1eec8
2026-01-08 04:53:16 +01:00
Andrew Kelley ce89006035 std.Io.Kqueue: fix bitrot 2026-01-07 18:00:36 -08:00
Andrew Kelley c0092f5394 std.Io: expose Kqueue and IoUring directly 2026-01-07 17:33:07 -08:00
Andrew Kelley cbd75b484f std.posix: remove recvfrom, recvmsg
see #6600
2026-01-07 17:33:07 -08:00
Andrew Kelley d96d735338 posix: remove send, sendto, sendmsg
see #6600
2026-01-07 17:33:07 -08:00
Andrew Kelley 791baefff2 goodbye posix.nanosleep
see #6600
2026-01-07 17:33:07 -08:00
Andrew Kelley 45b931a23f goodbye posix.fork
see #6600

nobody should be using fork anyway, especially Redis
2026-01-07 17:33:07 -08:00
Andrew Kelley 3961fe3de9 std: move posix.kevent to Io.Kqueue 2026-01-07 17:33:07 -08:00
Andrew Kelley 2c6304efc7 std: move posix.kqueue to Io.Kqueue.createFileDescriptor 2026-01-07 17:33:07 -08:00
Andrew Kelley be0a4dc299 goodbye posix.fstatat
see #6600
2026-01-07 17:33:07 -08:00
Andrew Kelley 829afe98d1 std.posix: remove getsockopt, getsockoptError
see #6600
2026-01-07 17:33:07 -08:00
Andrew Kelley 02c260dd06 goodbye posix.getsockname
see #6600
2026-01-07 17:33:07 -08:00
Andrew Kelley 1b43f27a91 std.posix: delete epoll APIs
see #6600
2026-01-07 17:33:07 -08:00
Andrew Kelley 55ad03e261 goodbye posix.accept
see #6600
2026-01-07 17:33:06 -08:00
Andrew Kelley c89df809b9 goodbye posix.listen
see #6600
2026-01-07 17:33:06 -08:00
Andrew Kelley 4a49546f59 goodbye posix.bind
see #6600
2026-01-07 17:33:06 -08:00
Andrew Kelley ed4dfdcff0 goodbye posix.shutdown
see #6600
2026-01-07 17:33:06 -08:00
Andrew Kelley d10a730480 goodbye posix.socket
see #6600
2026-01-07 17:33:06 -08:00
Andrew Kelley ceae9600e3 std.posix: remove setuid, seteuid, setgid, setegid, getuid, etc
applications and libraries should reach for the lower level APIs instead
2026-01-07 17:33:06 -08:00
Andrew Kelley 213ef95346 goodbye posix.open
see #6600
2026-01-07 17:33:06 -08:00
Andrew Kelley 2f372b3dc0 goodbye posix.write
see #6600
2026-01-07 17:33:06 -08:00
Andrew Kelley 520397b48f tests: delete redundant cases
These were originally supposed to be incremental test cases but have
long since been made redundant.
2026-01-07 17:33:06 -08:00
Andrew Kelley 7248b4a4e4 std.fs: deprecate base64 APIs
100% of std.fs is now deprecated.
2026-01-07 17:33:06 -08:00
Andrew Kelley c44e12dcd3 std: find a better home for the "preopens" concept 2026-01-07 17:33:06 -08:00
David Rubin 938efe4aab compiler-rt: fix f80 ceil/floor optimization
Our implementation did the classic add-sub rounding trick `(y = x +/- C =+ C - x)`
with `C = 1 / eps(T) = 2^(mantissa - 1)`. This approach only works for values whose
magnitude is below the rounding capacity of the constant. For a 64-bit mantissa
(like f80 has), `C = 2^63` only rounds for `|x| < 2^63`. Before we allowed this to
be ran on `e < bias + 64` aka `|x| < 2^64`. And because it isn't large enough,
we lose a bit to rounding.

For reference, the musl implementation does the same thing, using `mantissa - 1`:
https://git.musl-libc.org/cgit/musl/tree/src/math/ceill.c#n18
where `LDBL_MANT_DIG` is 64 for `long double` on x86.

This commit also combines the floor and ceil implementations into one generic one.
2026-01-08 00:45:52 +01:00
Steven Casper 52e0f78706 byteSwapAllFieldsAligned: use std.mem.Alignment API (#30724)
Following up on #30571

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30724
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
Co-authored-by: Steven Casper <sebastiancasper3@gmail.com>
Co-committed-by: Steven Casper <sebastiancasper3@gmail.com>
2026-01-08 00:44:08 +01:00
GasInfinity 335c0fcba1 feat(libzigc): add div, ldiv, lldiv and imaxdiv
* also remove musl implementation
2026-01-07 21:53:40 +01:00
Andrew Kelley 62d6bbc7dc Merge pull request 'std.Io: implement entropy (randomness)' (#30709) from random into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30709
2026-01-07 20:04:26 +01:00
Andrew Kelley 006afece53 std.crypto.tls.Client.Options: expose entropy_len 2026-01-07 11:03:37 -08:00
Andrew Kelley 5d0929c40d std.Io.Threaded.randomSecure: eliminate dead code 2026-01-07 11:03:37 -08:00
Andrew Kelley 5e5b328dac test-standalone: update cases from posix.getrandom 2026-01-07 11:03:37 -08:00
Andrew Kelley 1ddae8585a std.Io.Threaded: add procfs fallback for fileHardLink
oof what a clunky set of functionality we have here
2026-01-07 11:03:37 -08:00
Andrew Kelley 7e8c7e5696 std.Io: fix AT_SYMLINK_FOLLOW flags
hard linking has the backwards default, which uses a different flag
2026-01-07 11:03:37 -08:00
Andrew Kelley ee574f665c std.Io.Dir: introduce renamePreserve and use it in File.Atomic.link
breaking change: the error for renaming over a non-empty directory now
returns error.DirNotEmpty rather than error.PathAlreadyExists.
2026-01-07 11:03:37 -08:00
Andrew Kelley 8e1850e277 std.Io.Threaded: tweak logic for use_dev_urandom 2026-01-07 11:03:37 -08:00
Andrew Kelley 61cb5e4af9 compiler: fix unit tests 2026-01-07 11:03:37 -08:00
Andrew Kelley 0529fe3411 std.Io.Threaded: fix implementation of getRandomFd 2026-01-07 11:03:37 -08:00
Andrew Kelley 1eddc1737c std: add test coverage for Io.File.Atomic.link 2026-01-07 11:03:37 -08:00