Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Sep 2020 21:52:17 +0000
From:      Rick Macklem <rmacklem@uoguelph.ca>
To:        Konstantin Belousov <kostikbel@gmail.com>, Alan Somers <asomers@FreeBSD.org>
Cc:        "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:  <YTBPR01MB3966E158BCA0C56C5EE64CA8DD240@YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM>
In-Reply-To: <20200911214327.GY94807@kib.kiev.ua>
References:  <202009112049.08BKnavL032212@repo.freebsd.org>, <20200911214327.GY94807@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
Konstantin Belousov wrote:=0A=
>On Fri, Sep 11, 2020 at 08:49:36PM +0000, Alan Somers wrote:=0A=
>> Author: asomers=0A=
>> Date: Fri Sep 11 20:49:36 2020=0A=
>> New Revision: 365643=0A=
>> URL: https://svnweb.freebsd.org/changeset/base/365643=0A=
>>=0A=
>> Log:=0A=
>>   cp: fall back to read/write if copy_file_range fails=0A=
>>=0A=
>>   Even though copy_file_range has a file-system agnostic version, it sti=
ll=0A=
>>   fails on devfs (perhaps because the file descriptor is non-seekable?) =
In=0A=
>>   that case, fallback to old-fashioned read/write. Fixes=0A=
>>   "cp /dev/null /tmp/null"=0A=
>=0A=
>Devices are seekable.=0A=
>=0A=
>The reason for EINVAL is that vn_copy_file_range() checks that both in and=
 out=0A=
>vnodes are VREG.  For devfs, they are VCHR.=0A=
=0A=
I coded the syscall to the Linux man page, which states that EINVAL is retu=
rned=0A=
if either fd does not refer to a regular file.=0A=
Having said that, I do not recall testing the VCHR case under Linux. (ie. I=
t might=0A=
actually work and the man page turns out to be incorrect?)=0A=
=0A=
I will test this case under Linux when I get home next week, rick=0A=
=0A=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YTBPR01MB3966E158BCA0C56C5EE64CA8DD240>