From a64be7b5310c10edb5adc9b25ea1785f629554fb Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 14 May 2026 11:59:34 +0200 Subject: Fix libtest and add file descriptor leak detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libtest/common.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libtest/common.h') diff --git a/libtest/common.h b/libtest/common.h index 8d22b5b..54456d2 100644 --- a/libtest/common.h +++ b/libtest/common.h @@ -9,6 +9,7 @@ # include #endif #include +#include #include #include #include @@ -179,6 +180,14 @@ HIDDEN void *libtest_alloc(struct meminfo *); HIDDEN void libtest_free(void *, enum libtest_zero_check); HIDDEN int libtest_check_custom_mmap(void); + +/** + * action=1 mean start/resume tracking; + * action=0 mean suspend tracking; + * action=-1 mean stop tracking and report resource leaks + */ +HIDDEN int libtest_fd_tracking(int action); + #ifdef WITH_BACKTRACE HIDDEN void libtest_print_backtrace(FILE *, const char *prefix, const char *indent, size_t first, const struct backtrace *, ucontext_t *); -- cgit v1.2.3-70-g09d2