Date: Thu, 11 Jan 2024 01:14:28 GMT From: Rick Macklem <rmacklem@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 5c4da68ad785 - stable/14 - copy_file_range.2: Clarify that only regular files work Message-ID: <202401110114.40B1ESoV072270@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=5c4da68ad785e955976e7b73c281213abb85c23a commit 5c4da68ad785e955976e7b73c281213abb85c23a Author: Rick Macklem <rmacklem@FreeBSD.org> AuthorDate: 2023-12-29 22:59:00 +0000 Commit: Rick Macklem <rmacklem@FreeBSD.org> CommitDate: 2024-01-11 01:13:23 +0000 copy_file_range.2: Clarify that only regular files work PR#273962 reported that copy_file_range(2) did not work on shared memory objects and returned EINVAL. Although the reporter felt this was incorrect, it is what the Linux copy_file_range(2) syscall does. Since there was no collective agreement that the FreeBSD semantics should be changed to no longer be Linux compatible, copy_file_range(2) still works on regular files only. This man page update clarifies that. If, someday, copy_file_range(2) is changed to support non-regular files, then the man page will need to be updated to reflect that. PR: 273962 (cherry picked from commit 84b4342c0d7ac8a3187309a978d41e6765154cc1) --- lib/libc/sys/copy_file_range.2 | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/lib/libc/sys/copy_file_range.2 b/lib/libc/sys/copy_file_range.2 index c9fa593b7f4c..bcd9170842d5 100644 --- a/lib/libc/sys/copy_file_range.2 +++ b/lib/libc/sys/copy_file_range.2 @@ -23,13 +23,13 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 2, 2021 +.Dd December 28, 2023 .Dt COPY_FILE_RANGE 2 .Os .Sh NAME .Nm copy_file_range -.Nd kernel copy of a byte range from one file to another -or within one file +.Nd kernel copy of a byte range from one regular file to another +or within one regular file .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -178,9 +178,17 @@ are reset to the initial values for the system call. .Fa infd and .Fa outfd -refer to the same file and the byte ranges overlap or +refer to the same file and the byte ranges overlap. +.It Bq Er EINVAL +The .Fa flags -is not zero. +argument is not zero. +.It Bq Er EINVAL +Either +.Fa infd +or +.Fa outfd +refers to a file object that is not a regular file. .It Bq Er EIO An I/O error occurred while reading/writing the files. .It Bq Er EINTEGRITY
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202401110114.40B1ESoV072270>