bcmp(3)

bcmp3

Compare byte string

Usage

#include <strings.h>

int

bcmp(const void *b1, const void *b2, size_t len);

Library

Standard C Library (libc, -lc)

Overview

The bcmp() function compares byte string b1 against byte string b2, returning zero if they are identical, non-zero otherwise. Both strings are assumed to be len bytes long. Zero-length strings are always identical.

The strings may overlap.

Releases

163 releases since Mac OS X 10.0; the text changed 6 times.

  1. 10.0–10.1.5
  2. 10.2–10.2.8
  3. 10.3–10.3.9
  4. 10.4–10.4.11
  5. 10.5–10.6.8
  6. 10.7–10.12
  7. 10.12.1–26.5

History

A bcmp() function first appeared in 4.2BSD. Its prototype existed previously in ⟨string.h⟩ before it was moved to ⟨strings.h⟩ for IEEE Std 1003.1-2001 (“POSIX.1”) compliance.

From Libc 1752.120.2 in macOS 26.5. Parsed by carta from the page's mdoc source.