summaryrefslogtreecommitdiffstats
path: root/util/reset.c
blob: 62851492e06400f375c09abdfb1d6c826b1a87c2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "cachepc/uapi.h"

#include <sys/ioctl.h>
#include <fcntl.h>
#include <err.h>
#include <unistd.h>

int
main(int argc, const char **argv)
{
	int fd, ret;

	fd = open("/dev/kvm", O_RDONLY);
	if (fd < 0) err(1, "open");

	ret = ioctl(fd, KVM_CPC_RESET);
	if (ret) warn("ioctl KVM_CPC_RESET");

	close(fd);
}