* [RFC][PATCH 4/5] example for userspace scanner
@ 2008-01-21 16:14 Izik Eidus
0 siblings, 0 replies; only message in thread
From: Izik Eidus @ 2008-01-21 16:14 UTC (permalink / raw)
To: kvm-devel, andrea-atKUWr5tajBWk0Htik3J/w,
avi-atKUWr5tajBWk0Htik3J/w, dor.laor-atKUWr5tajBWk0Htik3J/w,
linux-mm-Bw31MaZKKs3YtjvyW6yDsg, yaniv-atKUWr5tajBWk0Htik3J/w
[-- Attachment #1: Type: text/plain, Size: 12 bytes --]
--
woof.
[-- Attachment #2: ksmscan.c --]
[-- Type: text/x-csrc, Size: 593 bytes --]
#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;
}
[-- Attachment #3: Type: text/plain, Size: 228 bytes --]
-------------------------------------------------------------------------
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/
[-- Attachment #4: Type: text/plain, Size: 186 bytes --]
_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-01-21 16:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-21 16:14 [RFC][PATCH 4/5] example for userspace scanner Izik Eidus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox