Date: Sun, 20 Sep 2020 15:58:09 +0000 From: Rick Macklem <rmacklem@uoguelph.ca> To: Alan Somers <asomers@freebsd.org>, FreeBSD Hackers <freebsd-hackers@freebsd.org> Subject: Re: RFC: copy_file_range(3) Message-ID: <YTBPR01MB39666188FC89399B0D632FE8DD3D0@YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM> In-Reply-To: <CAOtMX2iFZZpoj%2Bap21rrju4hJoip6ZoyxEiCB8852NeH7DAN0Q@mail.gmail.com> References: <CAOtMX2iFZZpoj%2Bap21rrju4hJoip6ZoyxEiCB8852NeH7DAN0Q@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Alan Somers wrote:=0A= >copy_file_range(2) is nifty, but it has a few sharp edges:=0A= >1) Certain file systems don't support it, necessitating a write/read based= =0A= >fallback=0A= >2) It doesn't handle sparse files as well as SEEK_HOLE/SEEK_DATA=0A= >3) It's slightly tricky to both efficiently deal with holes and also=0A= >promptly respond to signals=0A= >=0A= >These problems aren't terribly hard, but it seems to me like most=0A= >applications that use copy_file_range would share the exact same=0A= >solutions. In particular, I'm thinking about cp(1), dd(1), and=0A= >install(8). Those three could benefit from sharing a userland wrapper tha= t=0A= >handles the above problems.=0A= >=0A= >Should we add such a wrapper to libc? If so, what should it be called, an= d=0A= >should it be public or just private to /usr/src ?=0A= There has been a discussion on src-committers which I suggested should=0A= be taken to a public mailing list.=0A= =0A= The basic question is...=0A= Whether or not the copy_file_range(2) syscall should be compatible with=0A= the Linux one.=0A= When I did the syscall, I tried to make it Linux-compatible, arguing that= =0A= Linux is now a de-facto standard.=0A= The Linux syscall only works on regular files, which is why Alan's patch fo= r=0A= cp required a "fallback to the old way" for VCHR files like /dev/null.=0A= =0A= He is considering a wrapper in libc to provide FreeBSD specific semantics,= =0A= which I have no problem with, so long as the naming and man page make=0A= it clear that it is not compatible with the Linux syscall.=0A= (Personally, I'd prefer a wrapper in libc to making the actual syscall non-= Linux=0A= compatible, but that is just mho.)=0A= =0A= Hopefully this helps clarify what Alan is asking, rick=0A= =0A= -Alan=0A= _______________________________________________=0A= freebsd-hackers@freebsd.org mailing list=0A= https://lists.freebsd.org/mailman/listinfo/freebsd-hackers=0A= To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"= =0A= =0A=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YTBPR01MB39666188FC89399B0D632FE8DD3D0>