aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMotiejus Jakštys <motiejus@jakstys.lt>2022-08-19 09:42:42 +0300
committerVeikka Tuominen <git@vexu.eu>2022-08-26 15:36:40 +0300
commit9038528187932babc86558ec343511c635446a28 (patch)
treed55c4d92ef5e1a81a955a4cb33414237ce8f9daa /lib
parent3fa5415253695001149ad65ae6f2ca8d0fa63565 (diff)
downloadzig-9038528187932babc86558ec343511c635446a28.tar.gz
zig-9038528187932babc86558ec343511c635446a28.zip
copy_file_range: fix zigification of TXTBSY
From `copy_file_range(2)` errors: ETXTBSY Either fd_in or fd_out refers to an active swap file. Same error will be used in the upcoming `ioctl_ficlonerange(2)`: ETXTBSY One of the files is a swap file. Swap files cannot share storage.
Diffstat (limited to 'lib')
-rw-r--r--lib/std/os.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/os.zig b/lib/std/os.zig
index 24b438a53e..59f2a2173f 100644
--- a/lib/std/os.zig
+++ b/lib/std/os.zig
@@ -6251,7 +6251,7 @@ pub const CopyFileRangeError = error{
NoSpaceLeft,
Unseekable,
PermissionDenied,
- FileBusy,
+ SwapFile,
} || PReadError || PWriteError || UnexpectedError;
var has_copy_file_range_syscall = std.atomic.Atomic(bool).init(true);
@@ -6305,7 +6305,7 @@ pub fn copy_file_range(fd_in: fd_t, off_in: u64, fd_out: fd_t, off_out: u64, len
.NOSPC => return error.NoSpaceLeft,
.OVERFLOW => return error.Unseekable,
.PERM => return error.PermissionDenied,
- .TXTBSY => return error.FileBusy,
+ .TXTBSY => return error.SwapFile,
// these may not be regular files, try fallback
.INVAL => {},
// support for cross-filesystem copy added in Linux 5.3, use fallback