summaryrefslogtreecommitdiffstats
path: root/test/sevstep.c
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2022-10-05 15:33:22 +0200
committerLouis Burda <quent.burda@gmail.com>2022-10-05 15:33:32 +0200
commitda76c11f2059a8696a3df41844d49f82e6988843 (patch)
tree908ee65da099e713b6986434472485f57d6a00ea /test/sevstep.c
parent58d8565f015f9e06e1e51a0fe4654b966b2c27c0 (diff)
downloadcachepc-da76c11f2059a8696a3df41844d49f82e6988843.tar.gz
cachepc-da76c11f2059a8696a3df41844d49f82e6988843.zip
Fix uapi types and expose KVM_TRACK enum
Diffstat (limited to 'test/sevstep.c')
-rw-r--r--test/sevstep.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/sevstep.c b/test/sevstep.c
index 3ca7f03..39b610d 100644
--- a/test/sevstep.c
+++ b/test/sevstep.c
@@ -4,6 +4,8 @@
#include <sys/ioctl.h>
#include <err.h>
+#include <unistd.h>
+#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
@@ -13,7 +15,7 @@ main(int argc, const char **argv)
track_all_pages_t tracking;
int ret, fd;
- fd = open("/proc/cachepc");
+ fd = open("/proc/cachepc", O_RDONLY);
if (!fd) err(1, "open");
tracking.track_mode = KVM_PAGE_TRACK_ACCESS;