GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
MEMMEM(3) FreeBSD Library Functions Manual MEMMEM(3)

memmem
locate a byte substring in a byte string

Standard C Library (libc, -lc)

#include <string.h>

void *
memmem(const void *big, size_t big_len, const void *little, size_t little_len);

The memmem() function locates the first occurrence of the byte string little in the byte string big.

If little_len is zero big is returned (that is, an empty little is deemed to match at the beginning of big); if little occurs nowhere in big, NULL is returned; otherwise a pointer to the first character of the first occurrence of little is returned.

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

memmem() is a GNU extension.

The memmem() function first appeared in FreeBSD 6.0. It was replaced with an optimized O(n) implementation from the musl libc project in FreeBSD 12.0. Pascal Gloor <pascal.gloor@spale.com> provided this man page along with the previous implementation.

This function was broken in Linux libc up to and including version 5.0.9 and in GNU libc prior to version 2.1. Prior to FreeBSD 11.0 memmem returned NULL when little_len equals 0.
March 17, 2017 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.