Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / bcmp.9f
blob4ced6ed42d5c658bb43b2e6a375e422b42c1ffb8
1 '\" te
2 .\"  Copyright (c) 2006, Sun Microsystems, Inc.
3 .\"  All Rights Reserved
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH BCMP 9F "Jan 16, 2006"
8 .SH NAME
9 bcmp \- compare two byte arrays
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <sys/types.h>
14 #include <sys/ddi.h>
18 \fBint\fR \fBbcmp\fR(\fBconst void *\fR\fIs1\fR, \fBconst void *\fR\fIs2\fR, \fBsize_t\fR \fIlen\fR);
19 .fi
21 .SH INTERFACE LEVEL
22 .sp
23 .LP
24 Architecture independent level 1 (DDI/DKI).
25 .SH PARAMETERS
26 .sp
27 .ne 2
28 .na
29 \fB\fIs1\fR\fR
30 .ad
31 .RS 7n
32 Pointer to the first character string.
33 .RE
35 .sp
36 .ne 2
37 .na
38 \fB\fIs2\fR\fR
39 .ad
40 .RS 7n
41 Pointer to the second character string.
42 .RE
44 .sp
45 .ne 2
46 .na
47 \fB\fIlen\fR\fR
48 .ad
49 .RS 7n
50 Number of bytes to be compared.
51 .RE
53 .SH DESCRIPTION
54 .sp
55 .LP
56 The \fBbcmp()\fR function compares two byte arrays of length \fIlen\fR.
57 .SH RETURN VALUES
58 .sp
59 .LP
60 The \fBbcmp()\fR function returns \fB0\fR if the arrays are identical, or
61 \fB1\fR if they are not.
62 .SH CONTEXT
63 .sp
64 .LP
65 The \fBbcmp()\fR function can be called from user, interrupt, or kernel
66 context.
67 .SH SEE ALSO
68 .sp
69 .LP
70 \fBstrcmp\fR(9F)
71 .sp
72 .LP
73 \fIWriting Device Drivers\fR
74 .SH NOTES
75 .sp
76 .LP
77 Unlike \fBstrcmp\fR(9F), \fBbcmp()\fR does not terminate when it encounters a
78 null byte.