From fc0b70a60407e1e65610712a702f8286db3a328c Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 12 May 2026 21:22:54 +0200 Subject: Work on test code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libtest/libtest.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'libtest/libtest.h') diff --git a/libtest/libtest.h b/libtest/libtest.h index 41d1a41..9fa7e56 100644 --- a/libtest/libtest.h +++ b/libtest/libtest.h @@ -324,6 +324,25 @@ int libtest_have_custom_free_sized(void); */ int libtest_have_custom_free_aligned_sized(void); +/** + * Test whether mmap(3), munmap(3), and mremap(3) has + * been overridden, allowing allocations to be tracked, + * and memory allocation failures to be injected + * + * Tools like valgrind(1) prevent resource allocation + * functions from being overridden as they may override + * such functions themselves in order to detect leaks + * and invalid memory access patterns + * + * @return 1 if all three overridden, + * 0 if none have been overridden + * + * The case that only some of the three functions have + * been overriden, those will redirect to the real + * implementation and identify as non-overridden + */ +int libtest_have_custom_mmap(void); + /** * Print a stack trace, to standard error, provided -- cgit v1.2.3-70-g09d2