memscan(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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