--
woof.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <unistd.h>
#include "linux/ksm.h"
int main()
{
int fd;
int fd_scan;
int r;
fd = open("/dev/ksm", O_RDWR | O_TRUNC, (mode_t)0600);
if (fd == -1) {
fprintf(stderr, "couldnt even open it\n");
exit(1);
}
fd_scan = ioctl(fd, KSM_CREATE_SCAN);
if (fd_scan == -1) {
printf("KSM_CREATE_SCAN failed\n");
exit(1);
}
printf("created scanner!\n");
while(1) {
r = ioctl(fd_scan, KSM_SCAN, 100);
usleep(1000);
}
return 0;
}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel