-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Cat has fast path using splice system call. Unfortunately it does not work for many "file systems" reporting wrong file size.
In particular I have fuse file system returning incorrect size (zero or otherwise). It should be fine since one should treat file size on linux as a hint and read until EOF. That is what gnu cat does. It is also what uutils do in slow path! The fast path calling splice will stop at whatever file size is returned in stat. It is inconsistent and break stuff. Can we disable it please?
BTW: It works for cat /proc/self/stat which also report 0 size. The reason is probably for it somewhere in splice.c. But we're not going to change syscall behavior anyway. Calling the syscall in rust code looks fine, right?
BTW: I can see workaround if you really want to keep the splice around. But it is already quite a lot of code to do the splice. Is it worth even more hacks?