Date: Sat, 19 Sep 2020 11:59:58 -0600 From: Alan Somers <asomers@freebsd.org> To: Rick Macklem <rmacklem@uoguelph.ca> Cc: Konstantin Belousov <kostikbel@gmail.com>, "src-committers@freebsd.org" <src-committers@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org> Subject: Re: svn commit: r365643 - head/bin/cp Message-ID: <CAOtMX2hLLE1c=qbhSFnoRk2SfAg9sOk0PZtiyvNZ_u39YwGKmA@mail.gmail.com> In-Reply-To: <YTBPR01MB3966E158BCA0C56C5EE64CA8DD240@YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM> References: <202009112049.08BKnavL032212@repo.freebsd.org> <20200911214327.GY94807@kib.kiev.ua> <YTBPR01MB3966E158BCA0C56C5EE64CA8DD240@YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Sep 11, 2020 at 3:52 PM Rick Macklem <rmacklem@uoguelph.ca> wrote: > Konstantin Belousov wrote: > >On Fri, Sep 11, 2020 at 08:49:36PM +0000, Alan Somers wrote: > >> Author: asomers > >> Date: Fri Sep 11 20:49:36 2020 > >> New Revision: 365643 > >> URL: https://svnweb.freebsd.org/changeset/base/365643 > >> > >> Log: > >> cp: fall back to read/write if copy_file_range fails > >> > >> Even though copy_file_range has a file-system agnostic version, it > still > >> fails on devfs (perhaps because the file descriptor is non-seekable?) > In > >> that case, fallback to old-fashioned read/write. Fixes > >> "cp /dev/null /tmp/null" > > > >Devices are seekable. > > > >The reason for EINVAL is that vn_copy_file_range() checks that both in > and out > >vnodes are VREG. For devfs, they are VCHR. > > I coded the syscall to the Linux man page, which states that EINVAL is > returned > if either fd does not refer to a regular file. > Having said that, I do not recall testing the VCHR case under Linux. (ie. > It might > actually work and the man page turns out to be incorrect?) > > I will test this case under Linux when I get home next week, rick > Since there's no standard, I think it's fine for us to support devfs if possible.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOtMX2hLLE1c=qbhSFnoRk2SfAg9sOk0PZtiyvNZ_u39YwGKmA>