aboutsummaryrefslogtreecommitdiff
path: root/lib/std/os
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-08-10 23:02:04 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-08-11 06:22:05 -0400
commita82d7c20631b90de2f2298d351353041ac41650d (patch)
treeea10e8411448e594c15366657a7200e9b2bcb835 /lib/std/os
parent44a6172edbf6c99f4ebfeabb530756ed2a40c3c2 (diff)
downloadzig-a82d7c20631b90de2f2298d351353041ac41650d.tar.gz
zig-a82d7c20631b90de2f2298d351353041ac41650d.zip
std: add missing error to windows.WriteFile
I encountered this error today when testing the self-hosted compiler on Windows.
Diffstat (limited to 'lib/std/os')
-rw-r--r--lib/std/os/windows.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/std/os/windows.zig b/lib/std/os/windows.zig
index 3e42ee5f2d..c79ccb5113 100644
--- a/lib/std/os/windows.zig
+++ b/lib/std/os/windows.zig
@@ -517,6 +517,9 @@ pub const WriteFileError = error{
OperationAborted,
BrokenPipe,
NotOpenForWriting,
+ /// The process cannot access the file because another process has locked
+ /// a portion of the file.
+ LockViolation,
Unexpected,
};
@@ -597,6 +600,7 @@ pub fn WriteFile(
.IO_PENDING => unreachable,
.BROKEN_PIPE => return error.BrokenPipe,
.INVALID_HANDLE => return error.NotOpenForWriting,
+ .LOCK_VIOLATION => return error.LockViolation,
else => |err| return unexpectedError(err),
}
}