MEMCCHR(9)
π MEMCCHR(9) π
okay bestie, welcome to the Kernel Developer's Manual β yes we're in the kernel section, section 9, we're that girl now. this one's about memcchr, and she is lowkey the icon of "find me the one that's DIFFERENT" π¦
β¨ NAME β¨
memcchr β locate the complement of a byte in byte string
like. she finds the byte that's not the one you asked for. the contrarian queen. the main character who refuses to match. periodt π
πΈ SYNOPSIS πΈ
#include <sys/libkern.h>
void *
memcchr(const void *b, int c, size_t len);
π DESCRIPTION π
so the way that memcchr() works is: it locates the first occurrence of a byte unequal to c (converted to an unsigned char, bestie, don't forget the conversion π) in the string b.
that's it. that's the whole vibe. everybody else is out here looking for the byte that matches, and memcchr() said "no π i want the one that doesn't." iconic behaviour, honestly.
π RETURN VALUES π
memcchr() returns a pointer to the byte located π«Ά β or NULL if no such byte exists within len bytes.
ngl if you get NULL back it's giving "she searched the whole thing and everyone matched, no rebels found." handle it, don't just dereference it like a menace π
π SEE ALSO π
(the original, the classic, the one who finds the matching byte. memcchr is her chaotic little sister fr fr β¨)
β HISTORY β
the memcchr() function first appeared in FreeBSD 10.0. a debut. a moment. we love a queen with lore π
and that's the whole page, bestie!! π§ this one came from the Debian edition of the manual, dated January 1, 2012 β so yeah, vintage, but the energy is timeless. go forth and find your odd one out πβ¨
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2012 Ed Schouten <ed@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms