copy_file: ioctl_ficlone EACCES, EPERM as not supported. (#8425)

ioctl_ficlone may return EPERM (in LXC container), EACCESS (in Android).
Those error should be taken as ficlone being not supported instead of
error.

Refer to this coreutils bug report https://bugs.gnu.org/62404
This commit is contained in:
Chen Yufei
2024-01-24 10:24:54 +08:00
committed by GitHub
parent cff5dc0ee8
commit 04a99deb0e

View File

@@ -52,10 +52,9 @@ pub fn copyFile(in: InputType, out: InputType) CopyFileError!void {
.NOMEM => return error.OutOfMemory,
.NOSPC => return error.NoSpaceLeft,
.OVERFLOW => return error.Unseekable,
.PERM => return error.PermissionDenied,
.TXTBSY => return error.FileBusy,
.XDEV => {},
.BADF, .INVAL, .OPNOTSUPP, .NOSYS => {
.ACCES, .BADF, .INVAL, .OPNOTSUPP, .NOSYS, .PERM => {
bun.Output.debug("ioctl_ficlonerange is NOT supported", .{});
can_use_ioctl_ficlone_.store(-1, .Monotonic);
},