VALGRIND(3) Library Functions Manual VALGRIND(3)

KS_valgrind_is_running, KS_valgrind_make_mem_noaccess, KS_valgrind_make_mem_undefined, KS_valgrind_make_mem_definedValgrind utility functions

#include <libks/valgrind.h>

int
KS_valgrind_is_running(void);

int
KS_valgrind_make_mem_noaccess(const void *ptr, size_t len);

int
KS_valgrind_make_mem_undefined(const void *ptr, size_t len);

int
KS_valgrind_make_mem_defined(const void *ptr, size_t len);

The Valgrind API provides functions used to interact with Valgrind.

The () function can be used to determine if running under Valgrind or not.

The () function instructs Valgrind to mark the address range [ptr, ptr + len) as inaccessible.

The () function instructs Valgrind to mark the address range [ptr, ptr + len) as accessible and containing uninitialized data.

The () function instructs Valgrind to mark the address range [ptr, ptr + len) as accessible and containing initialized data.

The KS_valgrind_make_mem_noaccess(), KS_valgrind_make_mem_undefined() and KS_valgrind_make_mem_defined() functions returns non-zero while running under Valgrind and zero otherwise.

Anton Lindqvist <anton@basename.se>

OpenBSD 7.8 January 16, 2025 VALGRIND(3)