memscan(9)
π memscan β like, the manual page, bestie
okay so this is memscan(9) from the Kernel API Manual, and honestly? she's a little icon. tiny function, huge main character energy β¨
πΈ NAME πΈ
memscan β find a character in an area of memory. that's it. that's the whole job. she finds the byte and she serves π
β¨ SYNOPSIS β¨
void * memscan (void *addr , int c , size_t size );
like literally exactly that, copy it character for character or the compiler will simply pass away π
π«Ά ARGUMENTS π«Ά
addrβ the memory area. the neighborhood she's gonna go snooping in πcβ the byte to search for. the it-girl she's looking for πsizeβ the size of the area. how far she's allowed to wander, boundaries are important bestie πΈ
π DESCRIPTION π
returns the address of the first occurrence of c, or 1 byte past the area if c is not found.
no cap, that's the whole description. she scans, she finds the first c, she hands you back the address β and if c is nowhere to be found?? she still gives you a pointer, just 1 byte past the area. not a NULL. not a vibe check failure. a pointer one byte past the end. iconic behaviour, slightly unhinged, but that's her π₯
π SEE ALSO π
kernel file ./lib/string.c β the source, the origin story, the birth certificate π¦
and then the whole string-function friend group, in this exact order:
strncasecmp(9), stpcpy(9), strcmp(9), strncmp(9), strchr(9), strchrnul(9), strnchrnul(9), strrchr(9), strnchr(9), strspn(9), strcspn(9), strpbrk(9), strsep(9), memset(9), memset16(9), memset32(9), memset64(9), memcpy(9), memmove(9), memcmp(9), bcmp(9), strstr(9), strnstr(9), memchr(9), memchr_inv(9)
the way that's literally the entire ./lib group chat and memscan is in it π«Άπ
π«§ gentle reminder bestie: she returns 1 byte past the area when she can't find c β so please don't just dereference whatever comes back without thinking. that's a you problem and the kernel will be dramatic about it π
mwah that's the page!! from the kernel's ./lib directory, dated October 2026, and yes she's still memscan(9) β same number, same glory, no notes πβ¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms