rpcs3 icon indicating copy to clipboard operation
rpcs3 copied to clipboard

fs/linux: fix potential copy_file issue

Open Megamouse opened this issue 1 year ago • 1 comments

sendfile/sendfile64 is meant to be run in a loop, since there is no guarantee that a single call copies all the data. The current implementation may lead to corrupt files on linux.

Megamouse avatar Jun 08 '23 22:06 Megamouse

~~maybe sendfile indeed needs a loop but sendfile64 does not? I don't find any information the limitation of sendfile64.~~

elad335 avatar Jun 09 '23 10:06 elad335

Maybe there is no need to use sendfile64, actually, it seems Linux-specific

Nekotekina avatar Jun 11 '23 12:06 Nekotekina

you mean because of this? "The glibc sendfile() wrapper function transparently deals with the kernel differences."

Megamouse avatar Jun 11 '23 12:06 Megamouse

I think so, yes

Nekotekina avatar Jun 11 '23 13:06 Nekotekina