OpenBSD manual page server

Manual Page Search Parameters

MEMCMP(9) Kernel Developer's Manual MEMCMP(9)

skpc, scanc, bcmp, timingsafe_bcmp, memchr, memcmpkernel library byte string routines

#include <lib/libkern/libkern.h>

int
skpc(int mask, size_t size, u_char *cp);

int
scanc(u_int size, const u_char *cp, const u_char *table, int mask);

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

int
timingsafe_bcmp(const void *b1, const void *b2, size_t len);

void *
memchr(const void *b, int c, size_t len);

int
memcmp(const void *b1, const void *b2, size_t len);

The () function locates the first unsigned character of value different than mask inside the string cp.

The () function expects a string of indexes into the table table. Each table element is bitwise ANDed against mask.

() and scanc() expect the string to be of size size, and return the index relative to the end of the string where the match occurred, or zero if mask is not present in the string.

The remaining functions have the same semantics as their libc counterparts, bcmp(3), timingsafe_bcmp(3), memchr(3), and memcmp(3).

The memchr() and memcmp() functions conform to ANSI X3.159-1989 (“ANSI C89”).

The skpc() and scanc() functions are based on vax instructions of the same name.

April 23, 2018 OpenBSD-current