From nobody Thu Jun 25 10:07:58 2026 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 4gmDyW6gtMz6hwlV for ; Thu, 25 Jun 2026 10:08:03 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gmDyW4x4Qz3QRm for ; Thu, 25 Jun 2026 10:08:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782382083; 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=4rU2puQ4T/pHl8wBqhl4c2tPXpsjIBVIZ/GHKc29rCs=; b=Stv7t5Tix6hoz+TK3utKh6KTsZWgWlTOEStovm6gxHuHThNTsqWSR2DjXtxnrF4QfZzhQ0 Yr0gS9JLes4lp+DlF8qNqZke78HcHlLOCHP6L3ZUcfk+5TSQngxvRZQyqZeKpUvCBiCCBJ pks7MZizvldg+5NaeW1xSiQNqt+nXl792GMh1BGOKv/TZOeDDHzpXLSEraGBSVTUAR7mMN MS5Ufnf0U2u6iTn+bsr8PoRRcxh61hJzooshQshsYUW6x/gnVqqG/2beLjCNdDpwQfKFEy Y5+bv/dBQu9OyNaef0rlFUfJvlUqEuimLk044CrKeIobdtEoVq8+0juReYgDMg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782382083; a=rsa-sha256; cv=none; b=OTCpI7/KO1tW4Q6OXZ613R48+Yu1cDH6bTDvbPVPSOvaN6egwe3eXl8R8T5HdP9WClru19 MQ+GVF4Kfr59QwP7o2gw0h1X6Il6TOQcoJZGhbOKaGuCndPPVLOsjbuStk1S0D4RAUVT5g A+nFTXP8vJXoM+9EkZfqbr2Hq5xhOrzEagJj/OwYt9bhDmxVu/1Mr2RPd10sSfjSsJuk+W 8mqsJ+xYJIQE2/wT3JTQY5X7hz4THh3vki7U2+NMS2I0ox1FKYkvIdkj0ZvOSc0x2sRKcj 3xIZ7+DbmftOBAPxYSJ9eRUjxSfTfszjocBeeaexocRNSh2W6+PrSgN9wOF2tg== 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=1782382083; 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=4rU2puQ4T/pHl8wBqhl4c2tPXpsjIBVIZ/GHKc29rCs=; b=IJgZak7hZ2DRGUyGKfxaT0MAX7BKoD/gNTzBw7nyisoiJEkhZOp+hW3Zn08B73cy+9JUMR 1PgvpY0fuZO4uhPjbm5o5Ne+VyLZNy7EClYny9Wd8rz37J1yb33TqoXAzWRUXaU4d2V4V0 O9DtkCnNT1v8YhBwfkqH2C+Ko7BhIcOp5Rd5Is2UlnYDkSF9y3/HbN2jYxTYvsFl509JVA Ay1br8Qw+iHp+tYTK7LNhupcJVxj3d4OcxaIiZjiNhlLA37tB8PeSX8xD2e/sVSCQSwVDq PdcbvsaCmWap9tNBOYCOrhciP1W55aG8L93Yv2fGB4RG7e8thHCkc2Vz3CdCRg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gmDyW3CMsz1299 for ; Thu, 25 Jun 2026 10:08:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 20258 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 25 Jun 2026 10:07:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: b94f43890645 - main - Add kernel manpages for bcopy, memcpy, and memmove 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b94f438906451d4826d190d36b07e870443439ac Auto-Submitted: auto-generated Date: Thu, 25 Jun 2026 10:07:58 +0000 Message-Id: <6a3cfdfe.20258.7889c6a5@gitrepo.freebsd.org> The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=b94f438906451d4826d190d36b07e870443439ac commit b94f438906451d4826d190d36b07e870443439ac Author: Brooks Davis AuthorDate: 2026-06-25 10:05:02 +0000 Commit: Brooks Davis CommitDate: 2026-06-25 10:05:02 +0000 Add kernel manpages for bcopy, memcpy, and memmove We will add variants of memcpy and memmove to support CHERI so bootstrap the manpages from section 3. Mark bcopy as deprecated. Reviewed by: imp, kib, emaste Effort: CHERI upstreaming Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D57661 --- share/man/man9/Makefile | 3 ++ share/man/man9/bcopy.9 | 98 ++++++++++++++++++++++++++++++++++++++++++++++++ share/man/man9/memcpy.9 | 78 ++++++++++++++++++++++++++++++++++++++ share/man/man9/memmove.9 | 66 ++++++++++++++++++++++++++++++++ 4 files changed, 245 insertions(+) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 894a9971295c..fb9f5bca72c5 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -12,6 +12,7 @@ MAN= accept_filter.9 \ altq.9 \ atomic.9 \ backlight.9 \ + bcopy.9 \ bhnd.9 \ bhnd_erom.9 \ bios.9 \ @@ -228,7 +229,9 @@ MAN= accept_filter.9 \ mbuf_tags.9 \ mdchain.9 \ memcchr.9 \ + memcpy.9 \ memguard.9 \ + memmove.9 \ microseq.9 \ microtime.9 \ microuptime.9 \ diff --git a/share/man/man9/bcopy.9 b/share/man/man9/bcopy.9 new file mode 100644 index 000000000000..a82c66c66965 --- /dev/null +++ b/share/man/man9/bcopy.9 @@ -0,0 +1,98 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd June 19, 2026 +.Dt BCOPY 9 +.Os +.Sh NAME +.Nm bcopy +.Nd copy bytes in object +.Sh SYNOPSIS +.In sys/systm.h +.Ft void +.Fn bcopy "const void *src" "void *dst" "size_t len" +.Sh DESCRIPTION +The +.Fn bcopy +function copies +.Fa len +bytes from object +.Fa src +to object +.Fa dst . +The two objects may overlap. +If +.Fa len +is zero, no bytes are copied. +.Pp +The +.Fn bcopy +function is deprecated and +.Fn memcpy +or +.Fn memmove +should be used as appropriate in new code. +.Sh SEE ALSO +.Xr memcpy 9 , +.Xr memmove 9 +.Sh HISTORY +A +.Fn bcopy +function appeared in +.Bx 4.2 . +.Pp +.St -p1003.1-2008 +removes the specification of +.Fn bcopy +and it is marked as LEGACY in +.St -p1003.1-2004 . +New programs should use +.Xr memmove 3 . +If the input and output buffer do not overlap, then +.Xr memcpy 3 +is more efficient. +Note that +.Fn bcopy +takes +.Ar src +and +.Ar dst +in the opposite order from +.Fn memmove +and +.Fn memcpy . +In practice, +.In sys/systm.h +defines +.Fn bcopy +as a macro that calls +.Fn memmove +since +.Fx 12.0 . diff --git a/share/man/man9/memcpy.9 b/share/man/man9/memcpy.9 new file mode 100644 index 000000000000..e9675a55cf13 --- /dev/null +++ b/share/man/man9/memcpy.9 @@ -0,0 +1,78 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd June 19, 2026 +.Dt MEMCPY 9 +.Os +.Sh NAME +.Nm memcpy +.Nd copy bytes in memory +.Sh SYNOPSIS +.In sys/systm.h +.Ft void * +.Fn memcpy "void *dst" "const void *src" "size_t len" +.Sh DESCRIPTION +The +.Fn memcpy +function copies +.Fa len +bytes from object +.Fa src +to object +.Fa dst . +If +.Fa src +and +.Fa dst +overlap, the results are not defined. +.Sh RETURN VALUES +The +.Fn memcpy +function +returns the original value of +.Fa dst . +.Pp +.Sh SEE ALSO +.Xr bcopy 9 , +.Xr memmove 9 +.Sh STANDARDS +The +.Fn memcpy +function +conforms to +.St -isoC . +.Sh HISTORY +The +.Fn memcpy +function first appeared in +.At V +and was reimplemented for +.Bx 4.3 Tahoe . diff --git a/share/man/man9/memmove.9 b/share/man/man9/memmove.9 new file mode 100644 index 000000000000..54031dc37d96 --- /dev/null +++ b/share/man/man9/memmove.9 @@ -0,0 +1,66 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd June 19, 2026 +.Dt MEMMOVE 9 +.Os +.Sh NAME +.Nm memmove +.Nd copy bytes in memory +.Sh SYNOPSIS +.In sys/systm.h +.Ft void * +.Fn memmove "void *dst" "const void *src" "size_t len" +.Sh DESCRIPTION +The +.Fn memmove +function copies +.Fa len +bytes from object +.Fa src +to object +.Fa dst . +The two objects may overlap; +the copy is always done in a non-destructive manner. +.Sh RETURN VALUES +The +.Fn memmove +function returns the original value of +.Fa dst . +.Sh SEE ALSO +.Xr bcopy 9 , +.Xr memcpy 9 +.Sh STANDARDS +The +.Fn memmove +function +conforms to +.St -isoC .