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_SOURCEbefore you pull in the header, otherwise she simply will not appear. it's giving gatekept. π (seefeature_test_macros(7)for the lore, andmemory.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
- Copyright 1993, David Metcalfe <david@prism.demon.co.uk>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms