summaryrefslogtreecommitdiff
path: root/src/lib/libc/string/memcmp.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/string/memcmp.3')
-rw-r--r--src/lib/libc/string/memcmp.336
1 files changed, 19 insertions, 17 deletions
diff --git a/src/lib/libc/string/memcmp.3 b/src/lib/libc/string/memcmp.3
index 13901c1009..951a04ed8a 100644
--- a/src/lib/libc/string/memcmp.3
+++ b/src/lib/libc/string/memcmp.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: memcmp.3,v 1.7 2011/07/25 00:38:52 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -13,11 +15,7 @@
13.\" 2. Redistributions in binary form must reproduce the above copyright 15.\" 2. Redistributions in binary form must reproduce the above copyright
14.\" notice, this list of conditions and the following disclaimer in the 16.\" notice, this list of conditions and the following disclaimer in the
15.\" documentation and/or other materials provided with the distribution. 17.\" documentation and/or other materials provided with the distribution.
16.\" 3. All advertising materials mentioning features or use of this software 18.\" 3. Neither the name of the University nor the names of its contributors
17.\" must display the following acknowledgement:
18.\" This product includes software developed by the University of
19.\" California, Berkeley and its contributors.
20.\" 4. Neither the name of the University nor the names of its contributors
21.\" may be used to endorse or promote products derived from this software 19.\" may be used to endorse or promote products derived from this software
22.\" without specific prior written permission. 20.\" without specific prior written permission.
23.\" 21.\"
@@ -33,10 +31,7 @@
33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
35.\" 33.\"
36.\" from: @(#)memcmp.3 5.5 (Berkeley) 6/29/91 34.Dd $Mdocdate: July 25 2011 $
37.\" $Id: memcmp.3,v 1.1.1.1 1995/10/18 08:42:21 deraadt Exp $
38.\"
39.Dd June 29, 1991
40.Dt MEMCMP 3 35.Dt MEMCMP 3
41.Os 36.Os
42.Sh NAME 37.Sh NAME
@@ -49,8 +44,7 @@
49.Sh DESCRIPTION 44.Sh DESCRIPTION
50The 45The
51.Fn memcmp 46.Fn memcmp
52function 47function compares byte string
53compares byte string
54.Fa b1 48.Fa b1
55against byte string 49against byte string
56.Fa b2 . 50.Fa b2 .
@@ -60,10 +54,11 @@ bytes long.
60.Sh RETURN VALUES 54.Sh RETURN VALUES
61The 55The
62.Fn memcmp 56.Fn memcmp
63function 57function returns zero if the two strings are identical,
64returns zero if the the two strings are identical,
65otherwise returns the difference between the first two differing bytes 58otherwise returns the difference between the first two differing bytes
66(treated as unsigned char values, so that 59(treated as
60.Li unsigned char
61values, so that
67.Sq Li \e200 62.Sq Li \e200
68is greater than 63is greater than
69.Sq Li \&\e0 , 64.Sq Li \&\e0 ,
@@ -74,10 +69,17 @@ Zero-length strings are always identical.
74.Xr strcasecmp 3 , 69.Xr strcasecmp 3 ,
75.Xr strcmp 3 , 70.Xr strcmp 3 ,
76.Xr strcoll 3 , 71.Xr strcoll 3 ,
77.Xr strxfrm 3 72.Xr strxfrm 3 ,
73.Xr wmemcmp 3
78.Sh STANDARDS 74.Sh STANDARDS
79The 75The
80.Fn memcmp 76.Fn memcmp
81function 77function conforms to
82conforms to
83.St -ansiC . 78.St -ansiC .
79.Sh HISTORY
80The
81.Fn memcmp
82function first appeared in
83.At V
84and was reimplemented for
85.Bx 4.3 Tahoe .