From nobody Thu Jan 11 01:14:28 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 4T9RXN4r8mz56gGl; Thu, 11 Jan 2024 01:14:28 +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 4T9RXN4H71z4QHp; Thu, 11 Jan 2024 01:14:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704935668; 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=TzfcxPEzdxNZbTrlWHYnljKm9Mj6tGE2dO0rj5m5g8c=; b=bkK5VArlHv9+IE/152SbvZ4FLmbp6LM5mSPiqzT2rj/CgVY4/KIpFaY4fjtjjughTeGcIe LB+BDjlbtrtV9spQoOIZ+KyqSD8YV6lnLL2qRWWheEr60u0Oh9fGtxwAdqHlg8nogdJ3dK EG2Cf6amzt4m9MixPEde2FfMNZSHOjg8nQM85tAclSw2eMTnSdJX6Gg1N/YO64saFwFwGk LEC1+faPBGhKbP8W6XKn0bnf4GruJ89+KsH1D9W1GvJ94DIM3NsGSL+i1VDUoPJZ9tcB/w 0oY3sXWf7pdqw6b9hqWzbvNFHAJGrG7kqgD2t3M69rOIzqlwBXe+7TH81m+rdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704935668; 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=TzfcxPEzdxNZbTrlWHYnljKm9Mj6tGE2dO0rj5m5g8c=; b=fqMvXWe80tQ1K7IoO3jeyzhItz24xX7YG3AnPC20aOyM3jnnxIg1UK6wXnUXtX9KR/F6sF QBVkXlTIDYNl6z4ZVbBbsleYSITk9UsBAGUrix7eY/Wxi40m7RdvytWw4rpHy4Q2Ixshap DA+O34nHTbEZa67ktnFVjIaMa5mw/Eiy9D9OrFEDWtaT/caY5B2Ys/urKH+8PqRkK//bRX LViVFHturnof0HAf+PHRKvo8ttMdcsEGdPkb0nyspQ7rrESXMgWB3CdjiIp4DXb/oPj/9r cD/YdDFBZQEHXEDNdujDmJPoq3BUzchuuBhKBXuEHjiC4EZDrEa0uxl1b+QNDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704935668; a=rsa-sha256; cv=none; b=TVneXdlj09T5TNhMO7HflYI4fGxl6dLkVwkOt56t5QDDJNis6k+JIeCzKolYm3BUCCSrLG z+Vil++NXeUEvDGIx41C3pJZYAIi8w5y+3qtLCHzaiPP1/ECVMmhV+m2/8FyRX/LyPOoh1 puwHrLOu2ZsIWhtVLmUJspPlXXAfPYTa5iJB7l5LqzKCpufKFK+qIf8XE2PRe3UCDR7+4o iIcOxvJU8QWNnBZUBuAvnWhiiFDFElq1/dXQzsSKKAZN72RAngIWT1ckceYazUwT6mJZRU FhJuICrOtKoKFyL29GXeS7H+EEt8QgrXAmpzN68VUX/zZtCqjDH3W9CGN/VzqQ== 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 4T9RXN3Lrbzy8w; Thu, 11 Jan 2024 01:14:28 +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 40B1ESBQ072273; Thu, 11 Jan 2024 01:14:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B1ESoV072270; Thu, 11 Jan 2024 01:14:28 GMT (envelope-from git) Date: Thu, 11 Jan 2024 01:14:28 GMT Message-Id: <202401110114.40B1ESoV072270@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: 5c4da68ad785 - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: 5c4da68ad785e955976e7b73c281213abb85c23a Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=5c4da68ad785e955976e7b73c281213abb85c23a commit 5c4da68ad785e955976e7b73c281213abb85c23a Author: Rick Macklem AuthorDate: 2023-12-29 22:59:00 +0000 Commit: Rick Macklem 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