]> git.ipfire.org Git - thirdparty/man-pages.git/blobdiff - man3/memcmp.3
signal.7: Note async-signal-safe functions added by POSIX.1-2008 TC1
[thirdparty/man-pages.git] / man3 / memcmp.3
index d1d13c6ce7c7f8c3cd7b403a68559da94bf56854..57e407c320b1ab5c5e29c776b6e7836b74ece8c7 100644 (file)
@@ -27,7 +27,7 @@
 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
 .\"     386BSD man pages
 .\" Modified Sat Jul 24 18:55:27 1993 by Rik Faith (faith@cs.unc.edu)
-.TH MEMCMP 3  2014-12-31 "" "Linux Programmer's Manual"
+.TH MEMCMP 3  2015-08-08 "" "Linux Programmer's Manual"
 .SH NAME
 memcmp \- compare memory areas
 .SH SYNOPSIS
@@ -62,18 +62,30 @@ If
 .I n
 is zero, the return value is zero.
 .SH ATTRIBUTES
-.SS Multithreading (see pthreads(7))
-The
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.TS
+allbox;
+lb lb lb
+l l l.
+Interface      Attribute       Value
+T{
 .BR memcmp ()
-function is thread-safe.
+T}     Thread safety   MT-Safe
+.TE
 .SH CONFORMING TO
-SVr4, 4.3BSD, C89, C99, POSIX.1-2001.
+POSIX.1-2001, POSIX.1-2008, C89, C99, SVr4, 4.3BSD.
 .SH NOTES
 .PP
 Do not use
 .BR memcmp ()
 to compare security critical data, such as cryptographic secrets,
-because the required CPU time depends on the amount of equal bytes.
+because the required CPU time depends on the number of equal bytes.
+Instead, a function that performs comparisons in constant time is required.
+Some operating systems provide such a function (e.g., NetBSD's
+.BR consttime_memequal ()),
+but no such function is specified in POSIX.
+On Linux, it may be necessary to implement such a function oneself.
 .SH SEE ALSO
 .BR bcmp (3),
 .BR strcasecmp (3),