From mboxrd@z Thu Jan 1 00:00:00 1970 From: Izik Eidus Subject: [RFC][PATCH 4/5] example for userspace scanner Date: Mon, 21 Jan 2008 18:14:35 +0200 Message-ID: <4794C4EB.8090309@qumranet.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010408090705060407070309" To: kvm-devel , andrea-atKUWr5tajBWk0Htik3J/w@public.gmane.org, avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org, dor.laor-atKUWr5tajBWk0Htik3J/w@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, yaniv-atKUWr5tajBWk0Htik3J/w@public.gmane.org Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org This is a multi-part message in MIME format. --------------010408090705060407070309 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit -- woof. --------------010408090705060407070309 Content-Type: text/x-csrc; name="ksmscan.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ksmscan.c" #include #include #include #include #include #include #include #include #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; } --------------010408090705060407070309 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- 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/ --------------010408090705060407070309 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/kvm-devel --------------010408090705060407070309--