Commit Graph
438 Commits
Author SHA1 Message Date
Alex Rønne Petersen 7a7b944ef8 std.Target: remove hermit OS tag
Hermit is a unikernel with no stable syscall ABI; you must link its syscall
library statically to perform syscalls. Due to the way the project's build
system works, that means using Rust/Cargo. As such, it makes essentially zero
sense for Zig to support this target.
2026-10-12 14:35:23 +02:00
Alex Rønne Petersen 964e93dc47 move wcslen from libzigc to compiler-rt
Similar to strlen, LLVM 23+ will sometimes emit libcalls to this function even
when libc isn't linked.
2026-10-07 00:30:52 +02:00
Alex Rønne Petersen 5e754304de remove support for wasi-libc
closes https://github.com/ziglang/zig/issues/9342
closes https://github.com/ziglang/zig/issues/15005
closes https://github.com/ziglang/zig/issues/20747
closes https://github.com/ziglang/zig/issues/22570
closes https://codeberg.org/ziglang/zig/issues/30977
2026-10-04 18:23:18 +02:00
Alex Rønne Petersen f19259c85b std.c: fix Sigaction layout for sparc64-linux-gnu 2026-10-01 16:04:29 +02:00
Isaac Freund c53cb65568 std.Io.net: add control message utilities 2026-10-01 11:21:28 +02:00
Jacob Young 9fe0ebe108 Threaded: implement process spawning for macOS 2026-09-26 19:08:50 -04:00
Jacob Young 488c15320b runner: spawn compiler process 2026-09-26 19:08:50 -04:00
rpkak 8f61a7d34a libzigc: strnlen, wcsnlen: don't read past first zero
Previously is was assumed, that all of str[0..max] is readable.
2026-09-17 15:35:12 +02:00
Jakub Konka bafc561432 std.c: Add CTL and KERN defs targeting Darwin 2026-09-14 22:49:40 +02:00
Alex Rønne Petersen 96b1105dda std.c: add HWCAP definition for freebsd, illumos, linux, openbsd 2026-09-07 01:40:51 +02:00
Alex Rønne Petersen c09af80043 std.c: add elf_aux_info() 2026-09-07 01:29:52 +02:00
Alex Rønne Petersen 0e3010e54d std.c: add HW constants for freebsd 2026-09-06 09:50:49 +02:00
Alex Rønne Petersen 7ca0bf0f36 std.c: add more CTL constants for freebsd 2026-09-06 09:50:49 +02:00
Alex Rønne Petersen e374c98506 std.c: add CPU sysctl constants for aarch64-openbsd 2026-09-05 12:34:21 +02:00
Brandon Black e1c0f13ae5 std.c: define TCP options for several OSes
Primary motivation was the lack of TCP.NODELAY on multiple targets
that should have it.

Note that FreeBSD has a much larger set of defines in the "TCP_"
namespace than what I've pasted here, including a bunch of
non-option constants and extremely platform-specific features. I
stuck to just the simpler and more traditional options only for
now. The rest could be added later, and may need some thought as
how to best represent them.
2026-09-03 10:42:32 -05:00
Brandon Black e78ea8f2cb std.c: hook up IP, IPV6, IPTOS consts for Darwin
These were already defined in std.c.darwin, but weren't included
in the appropriate std.c top-level switches.
2026-09-02 18:24:20 -05:00
whatisaphone 9f048108e2 Give pollfd.revents a default value
The poll syscall only writes this field, never reads it
2026-08-20 21:53:39 +02:00
Linus Groh f6e32d1b3a std.c: Fix tc_lflag_t definition for serenity 2026-08-10 20:34:35 +01:00
mlugg 3d35188fe8 Merge pull request 'remove haiku from defaultSingleThreaded' (#32137) from ypsvlq/zig:master into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/32137
Reviewed-by: mlugg <services@mlugg.co.uk>
2026-08-07 19:24:07 +02:00
Έλλεν Εμίλια Άννα Zscheile 1b71e6e295 std.c.SIG: fix already taken tag value on Illumos 2026-08-05 19:10:56 +02:00
Elaine Gibson 845103fc9e std.Io.Threaded: implement park and unpark for haiku 2026-08-03 11:52:08 +01:00
Elaine Gibson ad6a79f327 std.c.haiku: cleanup 2026-08-03 09:59:04 +01:00
DavidandDavid Czihak 95396e2c5d std.c: update EV, EVFILT, NOTE enums for FreeBSD and macOS (#36206)
Co-authored-by: David Czihak <dcz-at@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/36206
Reviewed-by: Alex Rønne Petersen <alex@alexrp.com>
2026-08-02 12:25:11 +02:00
Justus Klausecker 69a26976ed zig fmt
Converts usages of `@intFromEnum` and `@enumFromInt` to instead use the
new `@backingInt` and `@fromBackingInt` builtins.
2026-07-17 23:30:26 +02:00
Yasin Gorgij 3210dc4b00 std.c: change the return value of 'getgrnam' function to '?*group' (#36078)
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/36078
Reviewed-by: Alex Rønne Petersen <alex@alexrp.com>
2026-07-07 10:49:14 +02:00
EJ c11d6e716d std.Io.Dir: support renamePreserve on Darwin systems (#35358)
Related to #35340.

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35358
2026-06-12 23:30:44 +02:00
Alex Rønne Petersen ee3c7a9f39 std.c: fix some symbol names under the msvc ABI 2026-06-01 14:46:00 +02:00
Huang Zhichao 0618743543 std.os.linux: make dev_t u32
glibc and musl define dev_t as u64, but in the kernel it is u32.

see https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/types.h?id=v7.0#n17
2026-05-31 07:29:58 +02:00
Elaine Gibson b9349d2a52 std.c: fix haiku sigrtmin/sigrtmax 2026-05-30 09:13:03 +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
jeffkdev 73d20ecd6a emscripten: Use SIG for sigaction types 2026-05-06 15:46:31 +02:00
Sawyer X 32ea57af50 Add stat for darwin aarch64 (#32178)
This fixes #32176.

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/32178
Reviewed-by: Alex Rønne Petersen <alex@alexrp.com>
2026-05-05 03:56:45 +02: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 ce198b7c28 std.c: fix Haiku definition of MSF 2026-04-28 12:52:03 +01:00
rpkak 03955476ad zigc: test and fix strtol and similar 2026-04-22 19:30:39 +02:00
Chris Boesch 3ea77badf9 libc: strdup, strndup, wcsdup (#31935)
Contributes to: #30978

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31935
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-04-22 01:57:58 +02:00
GasInfinity f8e9593851 fix: wasm requires strict function prototypes
* `pthread_mutex_*` and friends are also invalid then but they're not
  currently tested (and there's no wasi prong in `pthread_mutex_t`)
2026-04-21 14:45:24 +02:00
GasInfinity a2a91199d7 fix: add pthread_spin_* definitions for the BSDs in std.c
* each BSD has a different one
2026-04-21 10:31:47 +02:00
GasInfinity 61cd38e8ac feat(libzigc): add common implementations of pthread_spin_*
* and remove their mingw, musl and wasi implementations
2026-04-21 09:03:06 +02:00
Alex Rønne Petersenandrpkak 7ea8f842bc libzigc: move all unit tests from lib/c/ to test/c/
Before:

* test-zigc: run libzigc unit tests (part of test-modules)
* test-libc: run libc-test cases

Now:

* test-libc: run libc API unit tests (part of test-modules)
* test-libc-nsz: run libc-test cases

libc API unit tests (previously referred to as libzigc unit tests) now run for
all supported targets, even those we don't provide libzigc for. The idea is that
this will help us catch bad assumptions in the unit tests, as well as bugs in
other libcs.

I considered this setup:

* test-c: run libc API unit tests (part of test-modules)
* test-libc-nsz: run libc-test cases
* test-libc: both of the above

However, I do not like it because it gives a false sense of security; the full
module and C ABI test suites are still liable to catch libzigc bugs that test-c
and test-libc-nsz might not. So contributors should just run the test steps
outlined in https://codeberg.org/ziglang/zig/issues/30978.

Co-authored-by: rpkak <rpkak@noreply.codeberg.org>
2026-04-17 12:10:37 +02:00
Linus Groh 8abb14141e std.c: Fix serenity's futex() declaration
Two mistakes I made when translating from the C header:

- The timeout and userspace_address2 pointers should be nullable.
- futex_wait() and futex_wake() are defined as static functions and
  therefore not available as exported symbols. They're just thin
  wrappers around futex() anyway so that's fine.
2026-04-16 23:48:05 +01:00
Linus Groh 92ec9fa3d0 std.c: Remove serenity's serenity_{open,readlink}() functions
See: https://github.com/SerenityOS/serenity/commit/e4c989e45f0d30b7049b3f1d001cf4a87104d277
2026-04-16 23:48:05 +01: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
rpkak e74b98227e zigc: long double: call double function if long double and double are equivalent
For some of these functions and most targets this changes nothing,
either because long double and double are not equivalent or because
llvm did function deduplication.

But e.g. on aarch64-windows-gnu, ucrt provides hypot, but not hypotl.
Now hypotl calls hypot from ucrt instead of including the std.math.hypot
implementation in zigc.

Very trivial functions (like nanl) are not changed, because a function call would probably make this function more complex.
2026-04-16 07:05:30 +02:00
Elaine Gibson 7f71fe5bc7 std.c: fix definition of Sigaction for haiku 2026-04-14 19:10:05 +01:00
Elaine Gibson f0666586f6 std.c: add haiku readv_pos and write_pov 2026-04-14 12:04:41 +01: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
Andrew Kelley 2e4482cd14 std.Io.Dir: add resolve_beneath flag and implement for freebsd,macos 2026-03-27 01:23:04 -07: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