mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
std.os: fix sendto, poll, recvfrom when linking libc
Thank you to Brendan Hansknecht for this patch.
This commit is contained in:
parent
d6dec80261
commit
f749bf0942
1 changed files with 3 additions and 3 deletions
|
|
@ -2997,7 +2997,7 @@ pub fn sendto(
|
|||
while (true) {
|
||||
const rc = system.sendto(sockfd, buf.ptr, buf.len, flags, dest_addr, addrlen);
|
||||
switch (errno(rc)) {
|
||||
0 => return rc,
|
||||
0 => return @intCast(usize, rc),
|
||||
|
||||
EACCES => return error.AccessDenied,
|
||||
EAGAIN => if (std.event.Loop.instance) |loop| {
|
||||
|
|
@ -3063,7 +3063,7 @@ pub fn poll(fds: []pollfd, timeout: i32) PollError!usize {
|
|||
while (true) {
|
||||
const rc = system.poll(fds.ptr, fds.len, timeout);
|
||||
switch (errno(rc)) {
|
||||
0 => return rc,
|
||||
0 => return @intCast(usize, rc),
|
||||
EFAULT => unreachable,
|
||||
EINTR => continue,
|
||||
EINVAL => unreachable,
|
||||
|
|
@ -3096,7 +3096,7 @@ pub fn recvfrom(
|
|||
while (true) {
|
||||
const rc = system.recvfrom(sockfd, buf.ptr, buf.len, flags, src_addr, addrlen);
|
||||
switch (errno(rc)) {
|
||||
0 => return rc,
|
||||
0 => return @intCast(usize, rc),
|
||||
EBADF => unreachable, // always a race condition
|
||||
EFAULT => unreachable,
|
||||
EINVAL => unreachable,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue