man pages section 9: DDI and DKI Kernel Functions

Exit Print View

Updated: July 2014
 
 

bcmp(9F)

Name

bcmp - compare two byte arrays

Synopsis

#include <sys/types.h>
#include <sys/ddi.h>

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

Interface Level

Architecture independent level 1 (DDI/DKI).

Parameters

s1

Pointer to the first character string.

s2

Pointer to the second character string.

len

Number of bytes to be compared.

Description

The bcmp() function compares two byte arrays of length len.

Return Values

The bcmp() function returns 0 if the arrays are identical, or 1 if they are not.

Context

The bcmp() function can be called from user, interrupt, or kernel context.

See Also

strcmp(9F)

Writing Device Drivers for Oracle Solaris 11.2

Notes

Unlike strcmp(9F), bcmp() does not terminate when it encounters a null byte.