]> git.itanic.dy.fi Git - scan-pagemap/blob - main.c
main.c: Take the pid as an argument
[scan-pagemap] / main.c
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include <errno.h>
5
6 #include "parse.h"
7 #include "analyze.h"
8
9 int main(int argc, char *argv[])
10 {
11         struct pageframe pf;
12         int pid;
13
14         if (argc < 2) {
15                 printf("A pid needs to be given as an argument\n");
16                 return 1;
17         }
18
19         pid = atoi(argv[1]);
20
21         memset(&pf, 0, sizeof(pf));
22         read_pageframe(pid, &pf);
23         print_page_stats(&pf);
24
25         return 0;
26 }