Andrew Kelley
1382e41226
std.Io.Threaded: import std.Io.net
2025-10-29 06:20:49 -07:00
Andrew Kelley
2bcdde2985
compiler: update for introduction of std.Io
...
only thing remaining is using libc dns resolution when linking libc
2025-10-29 06:20:49 -07:00
Andrew Kelley
c2d1a339da
std.fs.File: begrudgingly add back deprecated APIs
...
I'm not ready to rework MachO linker file access at the moment.
2025-10-29 06:20:49 -07:00
Andrew Kelley
0732ff2263
std.Io.Threaded: implement connecting to unix sockets
2025-10-29 06:20:49 -07:00
Andrew Kelley
e8cea8accb
std.Io.Threaded: implement netListenUnix
2025-10-29 06:20:49 -07:00
Andrew Kelley
d680b9e9b2
std.Io.File: add WouldBlock to the error set
...
Even in an asynchronous world, the concept of a non-blocking flag is
useful because it determines under what conditions the operation
completes.
2025-10-29 06:20:49 -07:00
Andrew Kelley
539808239e
std.net: IPv6 parsing fixes
2025-10-29 06:20:49 -07:00
Andrew Kelley
d3f0c460ec
std.Io.net.HostName: fix DNS resolution
...
* merge conflict with changing behavior of takeDelimiterExclusive
* check bounds before adding to result array
2025-10-29 06:20:49 -07:00
Andrew Kelley
923a7bdd7e
std.Io.net: fix parsing IPv4-mapped IPv6 addresses
2025-10-29 06:20:49 -07:00
Andrew Kelley
e0e463bcf7
std.Io.net.Stream.Reader: fix not using buffer
2025-10-29 06:20:49 -07:00
Andrew Kelley
be1ae430a1
std.Io.Threaded.netReadPosix: support cancelation
2025-10-29 06:20:49 -07:00
Andrew Kelley
71ff6e0ef7
std: fix seekBy unit test
2025-10-29 06:20:49 -07:00
Andrew Kelley
d40803284e
progress towards compiler building again
2025-10-29 06:20:49 -07:00
Andrew Kelley
3b34622368
std.Io: add unix domain sockets API
...
note that "reuseaddr" does nothing for these
2025-10-29 06:20:49 -07:00
Andrew Kelley
9e681cab56
std.Uri: fix compilation error
2025-10-29 06:20:49 -07:00
Andrew Kelley
63801c4b05
std.crypto.Certificate.Bundle: remove use of File.readAll
2025-10-29 06:20:49 -07:00
Lukas Lalinsky
fcac8617b4
Add missing clobbers to context switching
...
This only shows in release mode, the compiler tries to preserve some
value in rdi, but that gets replaced inside the fiber. This would not
happen in the C calling convention, but in these normal Zig functions,
it can happen.
2025-10-29 06:20:49 -07:00
Andrew Kelley
7d478114ec
fix compilation errors introduced by rebasing
2025-10-29 06:20:49 -07:00
Andrew Kelley
b1733b7bce
std.Io: implement dirOpenFile
2025-10-29 06:20:49 -07:00
Andrew Kelley
8a1e6c8c39
std.Io: implement dirStatPath
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
eadfefa002
std.Io: implement dirMake
...
In the future, it might be nice to introduce a type for file system path
names. This would be a way to avoid having InvalidFileName in the error
set, since construction of such type could validate it above the
interface.
2025-10-29 06:20:49 -07:00
Andrew Kelley
e85df854aa
std.mem: improve containsAtLeastScalar implementation and rename
2025-10-29 06:20:49 -07:00
Andrew Kelley
ebcc6f166c
std.Io: bring back Timestamp but also keep Clock.Timestamp
...
this feels better
2025-10-29 06:20:49 -07:00
Andrew Kelley
89412fda77
std.Io: implement fileStat
2025-10-29 06:20:48 -07:00
Andrew Kelley
69b54b0cd1
remove bad assert
2025-10-29 06:20:48 -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
066864a0bf
std.zig.system: upgrade to std.Io.Reader
2025-10-29 06:20:48 -07:00
Andrew Kelley
b428612a20
WIP: hack away at std.Io return flight
2025-10-29 06:20:48 -07:00
Andrew Kelley
774df26835
WIP: hack at std.Io on a plane
2025-10-29 06:20:48 -07:00
Andrew Kelley
00f26cb0a4
WIP land the std.Io interface
...
fix std lib compilation errors caused by introducing std.Io
2025-10-29 06:20:48 -07:00
Andrew Kelley
85a6fea3be
std.Io.net.HostName: implement DNS name expansion
2025-10-29 06:20:48 -07:00
Andrew Kelley
f1a590c876
std.Io.net.HostName: implement DNS reply parsing
2025-10-29 06:20:48 -07:00
Andrew Kelley
62d0dd0d36
std.Io.Threaded.netReceive: recvmsg first, then poll
...
Calling recvmsg first means no poll syscall needed when messages are
already in the operating system queue. Empirically, this happens when
repeating a DNS query that has been already been made recently. In such
case, poll() is never called!
2025-10-29 06:20:48 -07:00
Andrew Kelley
a6347a68a9
std.Io.net: implement receiving connectionless messages
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
Andrew Kelley
cde5a51d0c
std.Io.net: make netSend support multiple messages
...
this lowers to sendmmsg on linux, and means Io.Group is no longer
needed, resulting in a more efficient implementation.
2025-10-29 06:20:48 -07:00
Andrew Kelley
b22400271f
std.Io.net.HostName: finish implementing DNS lookup
2025-10-29 06:20:48 -07:00
Andrew Kelley
2e1ab5d3f7
std.Io.Threaded: implement Group.cancel
2025-10-29 06:20:48 -07:00
Andrew Kelley
8e1da66ba1
std.Io: implement Group API
2025-10-29 06:20:48 -07:00
Andrew Kelley
5469db66e4
std.Thread.ResetEvent: make it more reusable
2025-10-29 06:20:48 -07:00
Andrew Kelley
f9d976a4e1
std.Io: rename asyncConcurrent to concurrent
2025-10-29 06:20:48 -07:00
Andrew Kelley
60c4bdb14c
Io.net: implement more networking
...
the next task is now implementing Io.Group
2025-10-29 06:20:48 -07:00
Andrew Kelley
8771a9f082
std.Io.net: progress towards DNS resolution
2025-10-29 06:20:48 -07:00
Andrew Kelley
5782158628
std.net: fix parsing IPv6 addr "::"
2025-10-29 06:20:48 -07:00
Andrew Kelley
885b3f8342
Io.net: finish implementing IPv6 parsing
2025-10-29 06:20:48 -07:00
Andrew Kelley
e7c9df9fb0
Io.net: use resolve for IPv6
...
/etc/resolv.conf might have IPv6 addresses with scope in it, so this is
needed.
2025-10-29 06:20:48 -07:00