man.bsd.lv manual page server

Manual Page Search Parameters

MEMMEM(3) Library Functions Manual MEMMEM(3)

memmemlocate substring in byte string

library “libc”

#include <string.h>

void *
memmem(const void *block, size_t blen, const void *pat, size_t plen);

The () function locates the first occurrence of the binary string pat of size plen bytes in the byte string block of size blen bytes.

The memmem() function returns a pointer to the substring located, or NULL if no such substring exists within block.

If plen is zero, block is returned, i.e. a zero length pat is deemed to match the start of the string, as with strstr(3).

bm(3), memchr(3), strchr(3), strstr(3)

The memmem() function is not currently standardized. However, it is meant to be API compatible with functions in FreeBSD and Linux.

memmem() first appeared in the Free Software Foundation's glibc library.

March 12, 2005 NetBSD-9.2