xref: /titanic_44/usr/src/man/man3c/bstring.3c (revision 9d12795f87b63c2e39e87bff369182edd34677d3)
te
Copyright (c) 2002, Sun Microsystems, Inc. All Rights Reserved
Copyright (c) 2015, Joyent, Inc.
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.
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.
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]
BSTRING 3C "Dec 31, 2014"
NAME
bstring, bcopy, bcmp, bzero, explicit_bzero - memory operations
SYNOPSIS

#include <strings.h>

void bcopy(const void *s1, void *s2, size_t n);

int bcmp(const void *s1, const void *s2, size_t n);

void bzero(void *s, size_t n);

void explicit_bzero(void *s, size_t n);
DESCRIPTION

The bcopy(), bcmp(), and bzero() functions operate as efficiently as possible on memory areas (arrays of bytes bounded by a count, not terminated by a null character). They do not check for the overflow of any receiving memory area. These functions are similar to the memcpy(), memcmp(), and memset() functions described on the memory(3C) manual page.

The bcopy() function copies n bytes from memory area s1 to s2. Copying between objects that overlap will take place correctly.

The bcmp() function compares the first n bytes of its arguments, returning 0 if they are identical and 1 otherwise. The bcmp() function always returns 0 when n is 0.

The bzero() function sets the first n bytes in memory area s to 0.

The explicit_bzero() function behaves the same as bzero(), except it should not be removed by the compiler's optimization passes.

WARNINGS

The bcopy() and explicit_bzero() functions take parameters backwards from memcmp(). See memory(3C).

ATTRIBUTES

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE ATTRIBUTE VALUE
Interface Stability See NOTES
MT-Level MT-Safe
SEE ALSO

memory(3C), attributes(5), standards(5)

NOTES

bcopy(), bcmp(), and bzero() are STANDARD. explicit_bzero() is COMMITTED.