blob: 748d1ab51039d4127fe539fd3a416290b304fa92 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
/* SPDX-License-Identifier: BSD-3-Clause */
/* Copyright 2019-2020, Intel Corporation */
#ifndef CORE_FAULT_INJECTION
#define CORE_FAULT_INJECTION
#include <stdlib.h>
#ifdef __cplusplus
extern "C" {
#endif
enum pmem_allocation_type { PMEM_MALLOC, PMEM_REALLOC };
#if FAULT_INJECTION
void core_inject_fault_at(enum pmem_allocation_type type,
int nth, const char *at);
int core_fault_injection_enabled(void);
#else
static inline void
core_inject_fault_at(enum pmem_allocation_type type, int nth, const char *at)
{
abort();
}
static inline int
core_fault_injection_enabled(void)
{
return 0;
}
#endif
#ifdef __cplusplus
}
#endif
#endif
|