MEMRMEM(3pub)
π MEMRMEM π (it's a 3pub page, from the C Programmer's Manual bestie)
okay so listen. you know how you can search a string for the last time something shows up? yeah. this is that, but for raw memory blocks. no strings attached, literally, it's void * and size_t and vibes only. it lives in publib and it is lowkey iconic. π¦
β¨ NAME β¨
memrmem β find the last occurrence of a memory block within another memory block. yes the r stands for reverse-ish energy. we're going backwards, bestie. π₯
πΈ SYNOPSIS πΈ
#include <publib.h>
void *memrmem(const void *v, size_t size,
const void *pat, size_t patsize);
like. look at her. four args, no drama. π
π DESCRIPTION π
memrmem finds the last occurrence of memory block pat within memory block v.
that's it. that's the whole thing. it's giving "I do one job and I do it flawlessly". no cap. π«Ά
β RETURN VALUE β
memrmem returns a pointer to the first byte of the match, if it finds any. if there are no matches, you get a null pointer. so like. check it. always check it. NULL is not a personality trait, it's a warning. π
π SEE ALSO π
go read those too, they're the extended universe. iykyk. π
π§ AUTHOR π§
Lars Wirzenius</p> (lars.wirzenius@helsinki.fi)
the man himself. we stan. π
okay that's the whole page, bestie, you ate it. this was MEMRMEM(3pub) from the C Programmer's Manual, brought to you by Publib π β no date on this one, so consider it timeless, like a little black dress but for syscalls. mwah. πβ¨
π¦ where this page comes from
- debian bookworm: publib-dev 0.40-3+b1 Β· BSD-2-Clause
- debian trixie: publib-dev 0.40-4 Β· BSD-2-Clause
- ubuntu jammy: publib-dev 0.40-3build1 Β· BSD-2-Clause
- ubuntu noble: publib-dev 0.40-3build1 Β· BSD-2-Clause
- ubuntu questing: publib-dev 0.40-4
- ubuntu resolute: publib-dev 0.40-4build1 Β· BSD-2-Clause
- ubuntu stonking: publib-dev 0.40-4build1 Β· BSD-2-Clause
- Copyright (c) 1994-2006 Lars Wirzenius. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms