forked from sysstat/sysstat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
systest.h
63 lines (50 loc) · 1.21 KB
/
systest.h
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
* sysstat: System performance tools for Linux
* (C) 1999-2019 by Sebastien Godard (sysstat <at> orange.fr)
*/
#ifndef _SYSTEST_H
#define _SYSTEST_H
#include <time.h>
#include <sys/utsname.h>
#include <sys/statvfs.h>
/* Test mode: Use alternate files and syscalls */
#ifdef TEST
#define PRE "./tests/root"
#define __time(m) get_unix_time(m)
#define __uname(m) get_uname(m)
#define __statvfs(m, n) get_fs_stat(m, n)
#define __getenv(m) get_env_value(m)
#define __alarm(m)
#define __pause() next_time_step()
#define ROOTDIR "./tests/root"
#define ROOTFILE "root"
#define TESTDIR "./tests"
#else
#define PRE ""
#define __time(m) time(m)
#define __uname(m) uname(m)
#define __statvfs(m, n) statvfs(m, n)
#define __getenv(m) getenv(m)
#define __alarm(m) alarm(m)
#define __pause() pause()
#endif
/*
***************************************************************************
* Functions prototypes
***************************************************************************
*/
#ifdef TEST
char *get_env_value
(char *);
int get_fs_stat
(char *, struct statvfs *);
void get_uname
(struct utsname *);
void get_unix_time
(time_t *);
void next_time_step
(void);
void int_handler
(int);
#endif
#endif /* _SYSTEST_H */