MEMMEM(3) NEWLIB MEMMEM(3)NAME
6.9 `memmem'--find memory segment
SYNOPSIS
#include <string.h>
char *memmem(const void *S1, size_t L1, const void *S2,
size_t L2);
DESCRIPTION
Locates the first occurrence in the memory region pointed to by S1 with
length L1 of the sequence of bytes pointed to by S2 of length L2. If
you already know the lengths of your haystack and needle, `memmem' can
be much faster than `strstr'.
RETURNS
Returns a pointer to the located segment, or a null pointer if S2 is
not found. If L2 is 0, S1 is returned.
PORTABILITY
`memmem' is a newlib extension.
`memmem' requires no supporting OS subroutines.
SEE ALSOmemmem is part of the library. The full documentation for is main‐
tained as a Texinfo manual. If info and are properly installed at your
site, the command
info
will give you access to the complete manual.
NEWLIB April 2010 MEMMEM(3)