authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-11-02 15:15:56-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-11-02 15:15:56-04:00
logf749bf094249bc6b48e3359dd99715ae7fec176e
tree194ba6e7f92f18f50d8e6963a34e8d210c822986
parentd6dec8026192503a8d64587063b2dc10b14df665
signaturelock-open Commit is signed but in an unrecognized format.

std.os: fix sendto, poll, recvfrom when linking libc

Thank you to Brendan Hansknecht for this patch.

1 files changed, 3 insertions(+), 3 deletions(-)

lib/std/os.zig+3-3
...@@ -2997,7 +2997,7 @@ pub fn sendto(...@@ -2997,7 +2997,7 @@ pub fn sendto(
2997 while (true) {2997 while (true) {
2998 const rc = system.sendto(sockfd, buf.ptr, buf.len, flags, dest_addr, addrlen);2998 const rc = system.sendto(sockfd, buf.ptr, buf.len, flags, dest_addr, addrlen);
2999 switch (errno(rc)) {2999 switch (errno(rc)) {
3000 0 => return rc,3000 0 => return @intCast(usize, rc),
30013001
3002 EACCES => return error.AccessDenied,3002 EACCES => return error.AccessDenied,
3003 EAGAIN => if (std.event.Loop.instance) |loop| {3003 EAGAIN => if (std.event.Loop.instance) |loop| {
...@@ -3063,7 +3063,7 @@ pub fn poll(fds: []pollfd, timeout: i32) PollError!usize {...@@ -3063,7 +3063,7 @@ pub fn poll(fds: []pollfd, timeout: i32) PollError!usize {
3063 while (true) {3063 while (true) {
3064 const rc = system.poll(fds.ptr, fds.len, timeout);3064 const rc = system.poll(fds.ptr, fds.len, timeout);
3065 switch (errno(rc)) {3065 switch (errno(rc)) {
3066 0 => return rc,3066 0 => return @intCast(usize, rc),
3067 EFAULT => unreachable,3067 EFAULT => unreachable,
3068 EINTR => continue,3068 EINTR => continue,
3069 EINVAL => unreachable,3069 EINVAL => unreachable,
...@@ -3096,7 +3096,7 @@ pub fn recvfrom(...@@ -3096,7 +3096,7 @@ pub fn recvfrom(
3096 while (true) {3096 while (true) {
3097 const rc = system.recvfrom(sockfd, buf.ptr, buf.len, flags, src_addr, addrlen);3097 const rc = system.recvfrom(sockfd, buf.ptr, buf.len, flags, src_addr, addrlen);
3098 switch (errno(rc)) {3098 switch (errno(rc)) {
3099 0 => return rc,3099 0 => return @intCast(usize, rc),
3100 EBADF => unreachable, // always a race condition3100 EBADF => unreachable, // always a race condition
3101 EFAULT => unreachable,3101 EFAULT => unreachable,
3102 EINVAL => unreachable,3102 EINVAL => unreachable,