453055 shared_timed_mutex drd test fails with "Lock shared failed" message
453602 Missing command line option to enable/disable debuginfod
452802 Handle lld 9+ split RW PT_LOAD segments correctly
+454040 s390x: False-positive memcheck:cond in memmem on arch13 systems
456171 [PATCH] FreeBSD: Don't record address errors when accessing the 'kern.ps_strings' sysctl struct
n-i-bz Implement vgdb invoker on FreeBSD
20430 WMEMCHR
20440 WCSNLEN
20450 WSTRNCMP
+ 20460 MEMMEM
*/
#if defined(VGO_solaris)
#endif
+/*---------------------- memmem ----------------------*/
+
+#define MEMMEM(soname, fnname) \
+ void* VG_REPLACE_FUNCTION_EZU(20460,soname,fnname) \
+ (const void* haystack, SizeT hlen, const void* needle, SizeT nlen); \
+ void* VG_REPLACE_FUNCTION_EZU(20460,soname,fnname) \
+ (const void* haystack, SizeT hlen, const void* needle, SizeT nlen) \
+ { \
+ const HChar* h = haystack; \
+ const HChar* n = needle; \
+ \
+ /* If the needle is the empty string, match immediately. */ \
+ if (nlen == 0) return CONST_CAST(void *,h); \
+ \
+ HChar n0 = n[0]; \
+ \
+ for (; hlen >= nlen; hlen--, h++) { \
+ if (h[0] != n0) continue; \
+ \
+ UWord i; \
+ for (i = 1; i < nlen; i++) { \
+ if (n[i] != h[i]) \
+ break; \
+ } \
+ if (i == nlen) \
+ return CONST_CAST(HChar *,h); \
+ \
+ } \
+ return NULL; \
+ }
+
+#if defined(VGP_s390x_linux)
+ MEMMEM(VG_Z_LIBC_SONAME, memmem)
+#endif
+
/*---------------------- strpbrk ----------------------*/