]> git.itanic.dy.fi Git - scan-pagemap/commitdiff
main.c: Take the pid as an argument
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Sat, 3 Jul 2010 15:19:06 +0000 (18:19 +0300)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Sat, 3 Jul 2010 15:19:06 +0000 (18:19 +0300)
Using hard coded values is bit silly..

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
main.c

diff --git a/main.c b/main.c
index 70fd8160420613ce17176257d466eb85b187efc7..cf534a0010ec487613e11cc478965f8e6f3ed10e 100644 (file)
--- a/main.c
+++ b/main.c
@@ -9,9 +9,17 @@
 int main(int argc, char *argv[])
 {
        struct pageframe pf;
+       int pid;
+
+       if (argc < 2) {
+               printf("A pid needs to be given as an argument\n");
+               return 1;
+       }
+
+       pid = atoi(argv[1]);
 
        memset(&pf, 0, sizeof(pf));
-       read_pageframe(2266, &pf);
+       read_pageframe(pid, &pf);
        print_page_stats(&pf);
 
        return 0;