Re: proposed revision to memory.h(3head)
Alejandro Colomar <[email protected]> Mon, 3 Aug 2026 02:47:12 +0200
| Newsgroups | org.kernel.vger.linux-man |
|---|---|
| Message-ID | <am_jYJL6uAapMGXN@devuan> |
--uxz2sa7qo366benp Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable From: Alejandro Colomar <[email protected]> To: "G. Branden Robinson" <[email protected]> Cc: Keith Bostic <[email protected]>, [email protected] Subject: Re: proposed revision to memory.h(3head) Message-ID: <am_jYJL6uAapMGXN@devuan> References: <am3XeGZyi1Pvr77-@devuan> <[email protected]> <am4GT1OkqNZD9FF9@devuan> <[email protected]> <am4jxBOh_VRvhCQw@devuan> <CAETFuj2OwoyK9J85r2f0RoXbHbXKA4gQJ=JZ-7=QoqGcMwk0+Q@mail.gmail.com> <am51v4KmUmdzM-OT@devuan> <am5_uA4MSujYCS9X@devuan> <20260801235332.vc443gozbqkqdqm5@illithid> <am6HTtAMkEEkWjfl@devuan> MIME-Version: 1.0 In-Reply-To: <am6HTtAMkEEkWjfl@devuan> [CC trimmed] Hi Branden, > Date: 2026-08-02 02:27:44+0200 > From: Alejandro Colomar <[email protected]> > > > Date: 2026-08-01 18:53:32-0500 > > From: "G. Branden Robinson" <[email protected]> > > [...] > > If you like the foregoing, consider it: > >=20 > > Signed-off-by: G. Branden Robinson <[email protected]> >=20 > I'll probably modify it and note it as >=20 > Suggested-by: ... The final memory.h(3head) manual page is here. It contains a mix of your text and Keith's text. memory.h(3head) memory.h(3head) NAME memory.h - memory operations LIBRARY Standard C library (libc, -lc) SYNOPSIS #include <memory.h> DESCRIPTION Write bzero(3) memset(3) Copy memmove(3) memcpy(3) mempcpy(3) memccpy(3) strncpy(3) Catenate strncat(3) Duplicate strndup(3) strndupa(3) Compare memcmp(3) strncmp(3) strncasecmp(3) Search memchr(3) memrchr(3) memmem(3) STANDARDS BSD. These functions are also provided in <string.h>, as speci=E2=80=90 fied by ISO C. This is a historic mistake maintained for compatibility reasons. Don=E2=80=99t let that fool you; these functions don=E2=80=99t necessarily operate on strings. HISTORY SVr1, 4.3BSD. System V (1983) introduced an initial set of mem* func=E2=80=90 tions in a <memory.h> header file. 4.3BSD (1986) adopted them. C89 didn=E2=80=99t standardize this header file (without providing any motivation or mentions in the documented rationale), and instead crammed all these functions in <string.h>, re=E2=80=90 sulting in confusing programmers about the real purpose of these functions. Most C libraries, including the BSDs, glibc, and musl, provide <memory.h>. Illumos and gnulib don=E2=80=99t provide it, though, and instead use <string.h>. SEE ALSO string(3), string_copying(7) Linux man=E2=80=90pages 6.18=E2=80=9018... 2026=E2=80=9008=E2=80=9003 = memory.h(3head) You can already get it through git, so if you want to make any specific changes, please send a patch. The specific pages (e.g., memcpy(3)) have also been updated. I believe the pages now reflect carefully both what the standard says, and the more reasonable include, while also clearly pointing to this page where the full story is detailed, for those who wonder, so that they don't have to wonder and ask. A sample here: SYNOPSIS #include <memory.h> // See STANDARDS void *memcpy(size_t n; void dest[restrict n], const void src[restrict n], size_t n); STANDARDS C11, POSIX.1=E2=80=902008. ISO C and POSIX declare this function in <string.h>; see memory.h(3head). The commit message attributes the text to both of you. commit 44d6d3bbace4c5a459efb181bcd264b93a655698 Author: Alejandro Colomar <[email protected]> Date: 2026-08-02 01:20:46 +0200 man/man3head/memory.h.3: STANDARDS, HISTORY: Document some history abo= ut <string.h> and <memory.h> =20 This text is an adaptation of text suggested by Keith and Branden. =20 Suggested-by: Keith Bostic <[email protected]> Suggested-by: "G. Branden Robinson" <[email protected]> Cc: Sam James <[email protected]> Cc: Joseph Myers <[email protected]> Cc: Mark Harris <[email protected]> Cc: Nevin Liber <[email protected]> Cc: Collin Funk <[email protected]> Cc: JeanHeyd Meneide <[email protected]> Cc: Christopher Bazley <[email protected]> Cc: Bruno Haible <[email protected]> Cc: Paul Eggert <[email protected]> Cc: Serge Hallyn <[email protected]> Cc: Iker Pedrosa <[email protected]> Cc: Evgeny Grin <[email protected]> Cc: Kees Cook <[email protected]> Cc: Steve Summit <[email protected]> Cc: "Maciej W. Rozycki" <[email protected]> Cc: Arsen Arsenovi=C4=87 <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Alejandro Colomar <[email protected]> Have a lovely night! Alex --=20 <https://www.alejandro-colomar.es> --uxz2sa7qo366benp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEES7Jt9u9GbmlWADAi64mZXMKQwqkFAmpv5QoACgkQ64mZXMKQ wqmZQg/9GsUr/C6E36IBium5jLQ5ePEdkhp2fQULtx7I6Eh/OL1CN8Qz6KmdD9Ok yjAzdLBrQmIC+72I6ct5QxyLJU0TUZLqeyHfS1yV3r00ybHe82ZNRSXeXUwnaiKP 5+AKgEGpiwKRlJ82GTX2jxKS2Sk4NqBI8tTOT+KynkNKql6SjOkPgIAYr+YPyAkc JJ8GO9IskMcI4gt41Pb6uk9nSDt9MTr7s9sH703jglDRmVdRHQAS97XTg9KzEPVL udI2E0sx8NnLVMfup6JJXEaA7Hj59oNWTO/zq9tf/E+rUcrXSigylxg8pam7swEf uL7fD7pm6cw1t38xXEBDeLHFebVgq9l/FuUTxpwCzDFs1iSkFwME/QHFNfe0kfgY zUcVwGLHnwpngBF/n+LleVXEIKVdvH1bzbVMDtbEVuXu4JUiuecrwFM+tcNjq5Lo oTuVd+UCSH1Lh1HzSKuJUvzzyoY3qAR5H5OYvbB1c9lnc9owZjtIzd3fyUPIXswO g37bDMSBvepCuOcnOuRK7+eMFsMsC1obB3LOb+70CKFVDZTXrK+7z2mfiMgPw7dD nJv0qITcmfdWzfVi5L6f5WGYSWaX2SIy1x35Aw1LVY1UEW0TlSW+vlPSf2wLGStE rzJgHv003zhTaWuhfhfaAV4Aq5kVRhv2TNJCfnx9weki3TtrLCA= =Gyzs -----END PGP SIGNATURE----- --uxz2sa7qo366benp--