From nobody Fri Dec 29 23:00:50 2023 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 4T217k56thz55SXD; Fri, 29 Dec 2023 23:00:50 +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 4T217k4hmsz4FWm; Fri, 29 Dec 2023 23:00:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703890850; 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=frBU9J+A79JPa2YhYdFD/OvyHRjix0565w6TzMFG8CA=; b=CLJ33YoGZDtPaMGD5uZKCrd8QOekSCkHwQp0i/UNwvsSUS0+/pr4uCVpoIHJwkuto8R5mA Pn0jqcdDHgEse0gLmOw3seMcxpYvH50EP6S1sQ1BZwQl3f0C15ZSnKQlgNe3/+TvKvtjPU gY4gWA363tgxKDLlTlO7jcpfgN6pgTnSWsV1usfSXMkq+hsuNZPDumk9g4Pafndsy2rbQ9 ya6/C2iIYGsbd423Qb3uvfQUEFIc9bLSonmb7RO/HiDOs1GqxIuwCWb/CdqXTRUlBfqTn6 Mf8RIqa1Z5P7XnLuyl01RCA9WGhq8ctzOuAX7bgSUtsTQC/ghqYNfeTAQNykPg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703890850; a=rsa-sha256; cv=none; b=rke/UBzvoFqHGtdi9KF3OYPM72MV4gklxWIOsDpcdFrGDS55FKj9nDniBJ3eFyDhwb97Bs weRu6/9sJsn5cppEMKItgz/6qctSlYYl53dK9edt8o4hvZqkPctCz5GMGs+JKx5I5THSDc HuFYqXdCfzWKMSwI0zjGKVQC96u0s47wpjdOBYzcWSBx9EU8rqZrMg+sZuoQpESEkNKmpL JPU+KLAt2u13YBt2GMW6ZE770FiP76jUu7fTf7dpQD3tANnUrk3/kN/DNofe/3OCKZlqMs WwWEmk2E654xqRpYMggULG5UrP2jyfihC4l45lIYo74bNdPZh4HsNZr2IJdewA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703890850; 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=frBU9J+A79JPa2YhYdFD/OvyHRjix0565w6TzMFG8CA=; b=IlAb/EgMdkGh0TmStk9UZc7OQe/bHQ070zzOW068Sa7cxBc1w68TAurW/995NccZHAUM4t r/M30Pa3ddespeLmuvikl4VwhYu9VhLYcCeBkcb5zC+vL7OvrDTpokN9xcj+nHXNh25TbB 9/ew/0b/p4qnnVl+dE2BZIEKHyHhv2Ui0w5JcQxZr5uswCmAWn1PPAfS5DehK+0BoXLoDQ 46rzrXcH3617z8gLiunSdnPAbU7c5IY75i2ZLaesA53o1BNiKhPWDDHo8zk7cW8qwYM8EF 0bTSf6hrdj+Y9WM/IZuTIdh2dtN1HqBtby3sQzLubplUaQbobK7rZ6o4QzsR+w== 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 4T217k3m4Yz9H2; Fri, 29 Dec 2023 23:00:50 +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 3BTN0oN8067031; Fri, 29 Dec 2023 23:00:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BTN0oiH067028; Fri, 29 Dec 2023 23:00:50 GMT (envelope-from git) Date: Fri, 29 Dec 2023 23:00:50 GMT Message-Id: <202312292300.3BTN0oiH067028@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 84b4342c0d7a - main - 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/main X-Git-Reftype: branch X-Git-Commit: 84b4342c0d7ac8a3187309a978d41e6765154cc1 Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=84b4342c0d7ac8a3187309a978d41e6765154cc1 commit 84b4342c0d7ac8a3187309a978d41e6765154cc1 Author: Rick Macklem AuthorDate: 2023-12-29 22:59:00 +0000 Commit: Rick Macklem CommitDate: 2023-12-29 22:59:00 +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 Reviewed by: karels, pauamma_gundo.com (manpages) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43227 --- 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