]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
man/man3head/memory.h.3: STANDARDS, HISTORY: Document some history about <string...
authorAlejandro Colomar <alx@kernel.org>
Sat, 1 Aug 2026 23:20:46 +0000 (01:20 +0200)
committerAlejandro Colomar <alx@kernel.org>
Mon, 3 Aug 2026 00:07:04 +0000 (02:07 +0200)
This text is an adaptation of text suggested by Keith and Branden.

Suggested-by: Keith Bostic <keith@bostic.com>
Suggested-by: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Cc: Sam James <sam@gentoo.org>
Cc: Joseph Myers <josmyers@redhat.com>
Cc: Mark Harris <mark.hsj@gmail.com>
Cc: Nevin Liber <nevin@cplusplusguy.com>
Cc: Collin Funk <collin.funk1@gmail.com>
Cc: JeanHeyd Meneide <phdofthehouse@gmail.com>
Cc: Christopher Bazley <chris.bazley.wg14@gmail.com>
Cc: Bruno Haible <bruno@clisp.org>
Cc: Paul Eggert <eggert@cs.ucla.edu>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Cc: Evgeny Grin <k2k@drgrin.dev>
Cc: Kees Cook <keescook@chromium.org>
Cc: Steve Summit <scs@eskimo.com>
Cc: "Maciej W. Rozycki" <macro@orcam.me.uk>
Cc: Arsen Arsenović <arsen@aarsen.me>
Cc: bug-gnulib@gnu.org
Cc: libc-alpha@sourceware.org
Signed-off-by: Alejandro Colomar <alx@kernel.org>
man/man3head/memory.h.3head

index 786da968f9fdac5476802d63861338a72063b2ca..a702873ecd0d63b53bee0ae6c1465a330734264b 100644 (file)
@@ -52,6 +52,43 @@ Standard C library
 .BR memrchr (3)
 .TQ
 .BR memmem (3)
+.SH STANDARDS
+BSD.
+.P
+These functions are also provided in
+.IR <string.h> ,
+as specified by ISO C.
+This is a historic mistake maintained for compatibility reasons.
+Don't let that fool you;
+these functions don't necessarily operate on strings.
+.SH HISTORY
+SVr1, 4.3BSD.
+.P
+System V (1983)
+introduced an initial set of mem* functions
+in a
+.I <memory.h>
+header file.
+4.3BSD (1986)
+adopted them.
+.P
+C89 didn't standardize this header file
+(without providing any motivation or mentions in the
+.UR https://\:www.open\-std.org/\:jtc1/\:sc22/\:wg14/\:www/\:C89Rationale.pdf
+documented rationale
+.UE ),
+and instead crammed all these functions in
+.IR <string.h> ,
+resulting in confusing programmers
+about the real purpose of these functions.
+.P
+Most C libraries, including the BSDs, glibc, and musl,
+provide
+.I <memory.h>.
+.P
+Illumos and gnulib don't provide it, though,
+and instead use
+.IR <string.h> .
 .SH SEE ALSO
 .BR string (3),
 .BR string_copying (7)