aboutsummaryrefslogtreecommitdiff
path: root/lib/std/os.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-02-03 12:49:40 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-02-03 12:49:40 -0700
commitfab9b7110ed1fa7bb082aad5e095047441db2b24 (patch)
tree81fef60aa45e7980dab8f3e23e5b5e92b40ee0a9 /lib/std/os.zig
parentd20d69b59e6b65a99f45cb6a45c14e887034dd18 (diff)
parent60935decd318498529a016eeb1379d943a7e830d (diff)
downloadzig-fab9b7110ed1fa7bb082aad5e095047441db2b24.tar.gz
zig-fab9b7110ed1fa7bb082aad5e095047441db2b24.zip
Merge remote-tracking branch 'origin/master' into llvm16
Diffstat (limited to 'lib/std/os.zig')
-rw-r--r--lib/std/os.zig11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/std/os.zig b/lib/std/os.zig
index b71b17243d..3cee30c32d 100644
--- a/lib/std/os.zig
+++ b/lib/std/os.zig
@@ -550,7 +550,6 @@ pub fn abort() noreturn {
exit(0); // TODO choose appropriate exit code
}
if (builtin.os.tag == .wasi) {
- @breakpoint();
exit(1);
}
if (builtin.os.tag == .cuda) {
@@ -4514,7 +4513,7 @@ pub fn faccessatW(dirfd: fd_t, sub_path_w: [*:0]const u16, mode: u32, flags: u32
var nt_name = windows.UNICODE_STRING{
.Length = path_len_bytes,
.MaximumLength = path_len_bytes,
- .Buffer = @intToPtr([*]u16, @ptrToInt(sub_path_w)),
+ .Buffer = @qualCast([*:0]u16, sub_path_w),
};
var attr = windows.OBJECT_ATTRIBUTES{
.Length = @sizeOf(windows.OBJECT_ATTRIBUTES),
@@ -6029,7 +6028,7 @@ pub fn sendfile(
.BADF => unreachable, // Always a race condition.
.FAULT => unreachable, // Segmentation fault.
.OVERFLOW => unreachable, // We avoid passing too large of a `count`.
- .NOTCONN => unreachable, // `out_fd` is an unconnected socket.
+ .NOTCONN => return error.BrokenPipe, // `out_fd` is an unconnected socket
.INVAL, .NOSYS => {
// EINVAL could be any of the following situations:
@@ -6097,7 +6096,7 @@ pub fn sendfile(
.BADF => unreachable, // Always a race condition.
.FAULT => unreachable, // Segmentation fault.
- .NOTCONN => unreachable, // `out_fd` is an unconnected socket.
+ .NOTCONN => return error.BrokenPipe, // `out_fd` is an unconnected socket
.INVAL, .OPNOTSUPP, .NOTSOCK, .NOSYS => {
// EINVAL could be any of the following situations:
@@ -6179,7 +6178,7 @@ pub fn sendfile(
.BADF => unreachable, // Always a race condition.
.FAULT => unreachable, // Segmentation fault.
.INVAL => unreachable,
- .NOTCONN => unreachable, // `out_fd` is an unconnected socket.
+ .NOTCONN => return error.BrokenPipe, // `out_fd` is an unconnected socket
.OPNOTSUPP, .NOTSOCK, .NOSYS => break :sf,
@@ -6473,7 +6472,7 @@ pub fn recvfrom(
.BADF => unreachable, // always a race condition
.FAULT => unreachable,
.INVAL => unreachable,
- .NOTCONN => unreachable,
+ .NOTCONN => return error.SocketNotConnected,
.NOTSOCK => unreachable,
.INTR => continue,
.AGAIN => return error.WouldBlock,