1798 Commits

Author SHA1 Message Date
Andrew Kelley
8b269f7e18 std: make signal numbers into an enum
fixes start logic for checking whether IO/POLL exist
2025-10-29 06:20:51 -07:00
Andrew Kelley
6ccb53bff1 std.Io.Threaded: fix openSelfExe for Windows
missing a call to wToPrefixedFileW
2025-10-29 06:20:51 -07:00
Andrew Kelley
c87fbd5878 std.os.linux.IoUring: use linux msghdr
it disagrees with posix msghdr
2025-10-29 06:20:51 -07:00
Andrew Kelley
a3ddca3657 std.Io.Threaded: delete Windows implementation of if_nametoindex
Microsoft documentation says "The if_nametoindex function is implemented
for portability of applications with Unix environments, but the
ConvertInterface functions are preferred."

This was also the only dependency on iphlpapi.
2025-10-29 06:20:51 -07:00
Andrew Kelley
ab003cd054 std.Io.Threaded: implement netLookup for Windows 2025-10-29 06:20:51 -07:00
Andrew Kelley
dab8dd5e03 std.os.windows.ws2_32: remove 'A' variants 2025-10-29 06:20:51 -07:00
Andrew Kelley
d257b1337a std.Io.Threaded: fix compilation failures on Windows 2025-10-29 06:20:50 -07:00
Andrew Kelley
0b5179a231 std.Io.Threaded: implement netAccept for Windows 2025-10-29 06:20:50 -07:00
Andrew Kelley
34891b528e std.Io.Threaded: implement netListen for Windows 2025-10-29 06:20:50 -07:00
Andrew Kelley
aa6e8eff40 std.Io.Threaded: implement dirAccess for Windows 2025-10-29 06:20:50 -07:00
Andrew Kelley
10b1eef2d3 std: fix compilation errors on Windows 2025-10-29 06:20:50 -07:00
Andrew Kelley
21e195a1a9 std: move some windows path checking logic 2025-10-29 06:20:50 -07:00
Andrew Kelley
2d7d98da0c std.fs: use BadPathName rather than InvalidWtf8 on Windows 2025-10-29 06:20:50 -07:00
Andrew Kelley
3bf0ce65a5 fix miscellaneous compilation errors
- ILSEQ -> error.BadPathName
- implement dirStatPath for WASI
2025-10-29 06:20:50 -07:00
Andrew Kelley
90fdd21df6 std: move DNS record enum to a better namespace 2025-10-29 06:20:50 -07:00
Andrew Kelley
031044b399 std: fix macos compilation errors 2025-10-29 06:20:49 -07:00
Andrew Kelley
750b1431bf std: fix some Io compilation errors 2025-10-29 06:20:49 -07:00
Andrew Kelley
47aa5a70a5 std: updating to std.Io interface
got the build runner compiling
2025-10-29 06:20:48 -07:00
Andrew Kelley
961961cf85 std: fix msghdr and cmsghdr when using musl libc
glibc and linux kernel use size_t for some field lengths while POSIX and
musl use int. This bug would have caused breakage the first time someone
tried to call sendmsg on a 64-bit big endian system when linking musl
libc.

my opinion:
* msghdr.iovlen: kernel and glibc have it right. This field should
  definitely be size_t. With int, the padding bytes are wasted for no
  reason.
* msghdr.controllen: POSIX and musl have it right. 4 bytes is plenty for
  the length, and it saves 4 bytes next to flags.
* cmsghdr.len: POSIX and musl have it right. 4 bytes is plenty for the
  length, and it saves 4 bytes since the other fields are also 32-bits
  each.
2025-10-29 06:20:48 -07:00
Andrew Kelley
95dee2af9c std.Io: implement netSend 2025-10-29 06:20:48 -07:00
Andrew Kelley
bcb6760fa5 std.os.linux: remove unnecessary warnings from sendmmsg
The one about INT_MAX is self-evident from the type system.

The one about kernel having bad types doesn't seem accurate as I checked
the source code and it uses size_t for all the appropriate types,
matching the libc struct definition for msghdr and msghdr_const.
2025-10-29 06:20:48 -07:00
Andrew Kelley
3b80fde6f4 std.os.linux: remove sendmmsg workaround
This "fix" is too opinionated to belong here. Better instead to
document the pitfalls.
2025-10-29 06:20:48 -07:00
GasInfinity
55c0693c4a
fix: make compiler_rt and std.Io.Writer compile on 16-bit platforms. 2025-10-27 11:17:48 +01:00
Alex Rønne Petersen
f723d69a58
std.os.linux.tls: add hppa support
Turns out Linux on PA-RISC does system calls in a pretty fascinating way; see
arch/parisc/kernel/syscall.S for details.
2025-10-23 09:27:17 +02:00
Alex Rønne Petersen
aff557e4e8
std.os.linux.tls: add sh support 2025-10-23 09:27:17 +02:00
Alex Rønne Petersen
5e921261a0
std.os.linux.tls: add microblaze support
Implemented according to glibc because I'm pretty sure musl gets it wrong.
2025-10-23 09:27:17 +02:00
Alex Rønne Petersen
9fde44229c
std.os.linux.tls: add alpha support 2025-10-23 09:27:17 +02:00
Alex Rønne Petersen
3e2daa509a
std.Target: add arceb and xtensaeb Cpu.Arch tags 2025-10-23 09:27:17 +02:00
Wim de With
49eea79ec2 std.os.linux: add pivot_root syscall 2025-10-19 22:24:24 +02:00
Wim de With
5442e06632 std.os.linux: add setns syscall 2025-10-19 22:24:24 +02:00
Alex Rønne Petersen
c571840e71
std.os.linux: add or1k arch bits 2025-10-18 22:27:35 +02:00
Alex Rønne Petersen
35e819aac8
std.os.linux.tls: implement or1k support 2025-10-18 22:27:35 +02:00
Alex Rønne Petersen
6bf5b7f2b4
Merge pull request #25622 from alexrp/inline-asm-fixes
`std`: some miscellaneous inline asm fixes for mips, mips64, mipsn32, and x32
2025-10-18 22:26:09 +02:00
Alex Rønne Petersen
1466401c15
Merge pull request #25614 from squeek502/windows-rename-delete
windows: Always try using POSIX_SEMANTICS/etc for rename/delete
2025-10-18 20:45:22 +02:00
Alex Rønne Petersen
3585f79f44
std.os.linux: remove syscall7() on mips64/mipsn32
I'm not sure why this was here, but this is only a thing on O32, not N32/N64.
2025-10-18 14:01:41 +02:00
Alex Rønne Petersen
842de66db8
std.os.linux: fix some issues in x32 inline asm
ref https://github.com/ziglang/zig/issues/22189
2025-10-18 11:16:31 +02:00
Alex Rønne Petersen
f3eacec226
std.os.linux: fix some issues in mipsn32 inline asm
ref https://github.com/ziglang/zig/issues/22189
2025-10-18 11:16:31 +02:00
Alex Rønne Petersen
b8d776928a
std: make all MIPS inline asm safe for MIPS I
MIPS I has load hazards so we need to insert nops in a few places. This is not a
problem for MIPS II and later.

While doing this, I also touched up all the inline asm to use ABI register
aliases and a consistent formatting convention. Also fixed a few places that
didn't properly check if the syscall return value should be negated.
2025-10-18 11:16:31 +02:00
Brandon Black
d18f1dde41 os.linux.timeval: use same field names as std.c
Otherwise, the field names in std.posix.timeval vary by target os.
I think this was an accidental change during the work of #25610
2025-10-18 01:51:44 +02:00
Alex Rønne Petersen
1f8a72175b
Merge pull request #25610 from alexrp/std-os-linux-cleanup
`std.os.linux`: some miscellaneous cleanup in arch bits
2025-10-17 12:07:51 +02:00
Ryan Liptak
88fd8ce860 windows: Always try using POSIX_SEMANTICS/etc for rename/delete
The compile-time check against the minimum version here wasn't appropriate, since it still makes sense to try using FILE_RENAME_INFORMATION_EX even if the minimum version is something like `xp`, since that doesn't rule out the possibility of the compiled code running on Windows 10/11. This compile-time check was doubly bad since the default minimum windows version (`.win10`) was below the `.win10_rs5` that was checked for, so when providing a target like `x86_64-windows-gnu` it'd always rule out using this syscall.

After this commit, we always try using FILE_RENAME_INFORMATION_EX and then let the operating system tell us when some aspect of it is not supported. This allows us to get the benefits of these new syscalls/flags whenever it's actually possible.

The possible error returns were validated experimentally:
- INVALID_PARAMETER is returned when the underlying filesystem is FAT32
- INVALID_INFO_CLASS is returned on Windows 7 when trying to use FileRenameInformationEx/FileDispositionInformationEx
- NOT_SUPPORTED is returned on Windows 10 >= .win10_rs5 when setting a bogus flag value (I used `0x1000`)
2025-10-17 00:50:16 -07:00
Ryan Liptak
3eb3fbec9c windows: make FILE_DISPOSITION_ constants pub 2025-10-17 00:40:17 -07:00
Alex Rønne Petersen
29fb9e4da7
std.os.linux.tls: don't unnecessarily use std.posix 2025-10-17 02:46:47 +02:00
Alex Rønne Petersen
d5481e6536
std.os.linux: add incomplete x32 arch bits file
This is very likely full of wrong stuff. It's effectively just a copy of the
x86_64 file - needed because the former stopped using usize/isize. To be clear,
this is no more broken than the old situation was; this just makes the
brokenness explicit.
2025-10-17 01:20:33 +02:00
Alex Rønne Petersen
502eca7b09
std.os.linux: add incomplete mipsn32 arch bits file
This is very likely full of wrong stuff. It's effectively just a copy of the
mips64 file - needed because the former stopped using usize/isize. To be clear,
this is no more broken than the old situation was; this just makes the
brokenness explicit.
2025-10-17 01:20:33 +02:00
Alex Rønne Petersen
aa8e53908a
std.os.linux: clean up a bunch of dead consts 2025-10-17 01:20:33 +02:00
Alex Rønne Petersen
dc1bc52dd6
std.os.linux: retranslate F_* constants and Flock struct, and move out of arch bits
Flock is now equivalent to struct flock64, and the related F.* constants map to
the 64-bit variants on 32-bit systems.
2025-10-17 01:20:33 +02:00
Alex Rønne Petersen
cfdc0f0e34
std.os.linux: replace usize/isize in arch bits with fixed types for clarity 2025-10-17 01:20:33 +02:00
Alex Rønne Petersen
fc7a5f2ae4
std.os.linux: move some generic decls out of the arch bits 2025-10-17 01:20:31 +02:00
Alex Rønne Petersen
8970d80355
std.os.linux.thumb: remove some @setRuntimeSafety(false) with no clear purpose 2025-10-16 23:17:25 +02:00