memmem(3) Library Functions Manual memmem(3) memmem - C (libc, -lc) #define _GNU_SOURCE /* . feature_test_macros(7) */ #include void *memmem(size_t hsize, size_t nsize; const void haystack[hsize], size_t hsize, const void needle[nsize], size_t nsize); The memmem() function finds the start of the first occurrence of the substring needle of size nsize in the memory area haystack of size hsize. memmem() NULL, . attributes(7). +----------------------------+----------------------------------------------------------+--------------------------+ | | | | +----------------------------+----------------------------------------------------------+--------------------------+ |memmem() | | MT-Safe | +----------------------------+----------------------------------------------------------+--------------------------+ . musl libc 0.9.7; FreeBSD 6.0, OpenBSD 5.4, NetBSD, Illumos. glibc 2.0, needle , memmem() haystack. glibc 2.1. bstring(3), strstr(3) () aereiae , Alexey , Azamat Hackimov , Dmitriy S. Seregin , Dmitry Bolkhovskikh , ITriskTI , Max Is , Yuri Kozlov , ; GNU (GNU General Public License - GPL, 3 ) , - . - , , () () () . Linux man-pages 6.18 8 2026 . memmem(3)