memrchr(3)

πŸ’– memrchr(3) β€” bestie edition πŸ’–

okay so literally the whole vibe of this page is memrchr β€” the memory rear-search character function β€” and yes it's a Library Functions Manual entry, and yes it lives in your friendly neighborhood Standard C library (libc, and you link it with -lc). no cap. πŸ¦‹


✨ NAME ✨

memrchr β€” memory rear-search character. that's it, that's the girl. she finds a character in memory but backwards. πŸ”₯


πŸ“š LIBRARY πŸ“š

Standard C library (libc, -lc)


πŸŽ€ SYNOPSIS πŸŽ€

#define _GNU_SOURCE  // See feature_test_macros(7)
#include <string.h>  // see memory.h(3head)

void *memrchr(size_t n;
              const void s[n], int c, size_t n);
ngl bestie, you have to define _GNU_SOURCE before you pull in the header, otherwise she simply will not appear. it's giving gatekept. πŸ™ˆ (see feature_test_macros(7) for the lore, and memory.h(3head) for the header situation.)

🌸 DESCRIPTION 🌸

okay so memrchr() is basically memchr(3)'s iconic sibling 🫢 β€” except instead of starting at the front and walking forward, she starts at the end of the n bytes that s points to, and she searches backward. main character energy honestly. πŸ’…

  • memchr(3) β†’ forward from the beginning (walking in normally, casual) ✨
  • memrchr() β†’ backward from the end (making an entrance) πŸ‘‘

πŸ“ RETURN VALUE πŸ“

no thoughts, just vibes β€” and also: see memchr(3). she returns the exact same way her sibling does, no need to reinvent the wheel here. 😭


πŸ’œ ATTRIBUTES πŸ’œ

for the full explanation of what these words even mean, check out attributes(7). here's the tea:

  • memrchr() β€” Thread safety: MT-Safe βœ…

that's right girls, she's MT-Safe. thread-safe queen. go off. πŸ‘‘


⭐ STANDARDS ⭐

GNU.

sobbing softly, she is not in POSIX. if you need portable, this is not your girl. fr fr. πŸ’€

πŸ¦‹ HISTORY πŸ¦‹

she was born in glibc 2.2. a legend since day one. periodt. πŸŽ€


🌈 SEE ALSO 🌈


wrap-up check-in πŸ’– β€” this whole page is from Linux man-pages 6.20, dated 2026-08-10, and that's the <rainbow>memrchr(3)</rainbow> ✨ <rainbow>memrchr(3)</rainbow> ✨ header-and-footer realness, bestie. stan a thread-safe backwards searcher. bye mwah πŸ’…πŸ«ΆπŸŒΈ

πŸ“¦ where this page comes from
  • arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • πŸ“œ the page's license: Linux-man-pages-copyleft
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms