MEMCMP(9)

πŸ“¦
version 11.0 Β· 3 versions
, in nixpkgs unstable

🌸 NAME 🌸

memcmp β€” compare byte string. And yes bestie, this is the MEMCMP(9) kernel developer’s manual page, so you know it’s giving official Unix energy πŸ’…βœ¨


✨ SYNOPSIS ✨

#include <sys/systm.h>

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

πŸ’– DESCRIPTION πŸ’–

okay so memcmp() compares byte string b1 against byte string b2 🫢 Both strings are assumed to be len bytes long β€” no cap, that’s literally the setup πŸ’€


πŸŽ€ RETURN VALUES πŸŽ€

memcmp() returns zero if the two strings are identical 😌 otherwise it returns the difference between the first two differing bytes β€” and those bytes are treated as unsigned char values, so that '\200' is greater than '\0', for example 🌈

Zero-length strings are always identical, periodt πŸ’–


πŸ¦‹ STANDARDS πŸ¦‹

The memcmp() function conforms to ANSI X3.159-1989 (β€œANSI C89”) β€” iconic, standards-approved behavior fr fr πŸ‘‘


πŸŽ€ that’s the whole page, bestie! source/version vibes: Debian, dated July 7, 2001, and the manual is MEMCMP(9) β€” slay and goodbye πŸ’…βœ¨
πŸ“¦ where this page comes from
  • nixpkgs unstable: netbsd-source 11.0
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms