aboutsummaryrefslogtreecommitdiffstats
path: root/libtest/libtest.h
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-05-12 21:22:54 +0200
committerMattias Andrée <m@maandree.se>2026-05-12 21:22:54 +0200
commitfc0b70a60407e1e65610712a702f8286db3a328c (patch)
tree05f42c75245c1160c4bf7a7d391de7a16b109c83 /libtest/libtest.h
parentMisc (diff)
downloadlibrecrypt-fc0b70a60407e1e65610712a702f8286db3a328c.tar.gz
librecrypt-fc0b70a60407e1e65610712a702f8286db3a328c.tar.bz2
librecrypt-fc0b70a60407e1e65610712a702f8286db3a328c.tar.xz
Work on test code
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'libtest/libtest.h')
-rw-r--r--libtest/libtest.h19
1 files changed, 19 insertions, 0 deletions
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