From nobody Thu Jan 11 01:21:22 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T9RhL2nYDz56h6C; Thu, 11 Jan 2024 01:21:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T9RhL2LP2z4RNQ; Thu, 11 Jan 2024 01:21:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704936082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f0A7caeh/KeVSPgLSvb3noVkmrdRJOnv89dF6BTOjhU=; b=Z7ylAbusq7mXpI5TfTYXTAbQQxpVBFBERDRN36BOnGYQKwNAfO6a2nwRjgEhll1fKcFMeg VRKijohSm264+2o4YOL1DexrKi88YbXmCL3RV5kHrurXw8AwuzBb5UMauGGdZvkyTzL1gT c/Vt7AbizEpk46eWpmsbNgxrm5l7GU1dWriNGO4uOMX4VjsIXdvLCN0UGl3w2w8f2nAuyr X7cpNT47nKpSUJFhnxXgG1smUunzGtR8YBwMGDG+n618ZxQix9HuVdTLOjvVEn1olxUYbE 3r5KpMCaLxUgG5GymRGqiwY1+NWd2LurM/7qcw1PUa2a1390EUzwmqKanLOyyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704936082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f0A7caeh/KeVSPgLSvb3noVkmrdRJOnv89dF6BTOjhU=; b=dsdZK8Uv8TqyB05a+xFgnolbzxSP9NsqpQkKX2BuyXJEgqaCuJJWif41XxIxsUX2u38R0I Zh/eeM7yMVGMFfRLL0VjW0JAYefTZGB+exzmVimsASoW4HNviHVbsVEk4GVmiyU7Zyt9n1 Wi7CxUSrgWtAVXsvsEjzbVQapwM+WaRhKgClfpvN+GD73I6gDedWe8UH2YzTYaOfTF1r4O f6JYRJFBLFli6RunmCI7ecO0Yc2dQQHMPTySMxCtsFUi7kz+miNQuXiR5N+0WjSMVKDtn0 kk/vrFrt2mESL9AzWKekwgP2rOrz3gu8KkQ53MNzOY/iX1zQepZEBFqWdxdc3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704936082; a=rsa-sha256; cv=none; b=mDYKmhDizvkOg/6v5fmKhpxtAmqKFdM1G1PYgNQzsgMqjN/XLiVgRDVYHMXSxIr2G/r0C0 53RxuBL0l6Q0R3jCkbeAZxnAe+uUC/nMbNxjx9SnWd2tkdu+O6yN/9LSsN2tU/m13dlXFj gv5ho49tbJk54LME0liSCGO6b14KVfeA5qHxM0b/G40NTMx3MKNAps+xLn1zg+lrh/vr5x 11+sazefL3gMNoM99acHZG7Obj5R/Jc1zit6yGFGKFMIzGXVeJuxkHaz9UooX2Ew2yQKci aPlp5+AdOpYpaH/P5T12TmwgH2KLRLg7n+6FmojU3Z1t77NwPQHp1t/oD992/A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4T9RhL1QFczyX5; Thu, 11 Jan 2024 01:21:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B1LMHI085145; Thu, 11 Jan 2024 01:21:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B1LMln085142; Thu, 11 Jan 2024 01:21:22 GMT (envelope-from git) Date: Thu, 11 Jan 2024 01:21:22 GMT Message-Id: <202401110121.40B1LMln085142@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 6561a7141b56 - stable/13 - copy_file_range.2: Clarify that only regular files work List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6561a7141b5603235d18538f6c66322ed7fc67d3 Auto-Submitted: auto-generated The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=6561a7141b5603235d18538f6c66322ed7fc67d3 commit 6561a7141b5603235d18538f6c66322ed7fc67d3 Author: Rick Macklem AuthorDate: 2023-12-29 22:59:00 +0000 Commit: Rick Macklem CommitDate: 2024-01-11 01:20:35 +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