memmem
------

LSB specification:
 https://refspecs.linuxbase.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/baselib-memmem-3.html

Documentation:

  * Search Functions (libc),

  * man memmem.

Gnulib module: memmem or memmem-simple

Both modules implement the same replacement for the memmem function with the memmem module providing a replacement on more platforms where the existing memmem function has a quadratic worst-case complexity.

Portability problems fixed by either Gnulib module memmem-simple or memmem:

  * This function is missing on some platforms: Mac OS X 10.5, FreeBSD 5.2.1, OpenBSD 4.0, Minix 3.1.8, HP-UX 11, IRIX 6.5, Solaris 10, mingw, MSVC 14.

  * This function has reversed arguments on some older platforms: Linux libc 5.0.9

  * This function can trigger false positives for long periodic needles on some platforms: glibc 2.12, Cygwin 1.7.7.

  * This function returns incorrect values in some cases, such as when given an empty needle: glibc <= 2.0, macOS 12.5, AIX 7.2, Solaris 11.3, Cygwin 1.5.x.

Performance problems fixed by Gnulib module memmem:

  * This function has quadratic instead of linear worst-case complexity on some platforms: glibc 2.8, macOS 12.5, FreeBSD 11.4, NetBSD 8.2, OpenBSD 6.6, AIX 7.2, Solaris 11.4, Cygwin 1.5.x. Note for small needles the replacement may be slower.

Portability problems not fixed by Gnulib: