--- projects/libstatgrab/examples/page_stats.c 2004/01/16 15:54:52 1.5 +++ projects/libstatgrab/examples/page_stats.c 2004/04/05 16:23:08 1.8 @@ -16,6 +16,8 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id: page_stats.c,v 1.8 2004/04/05 16:23:08 tdb Exp $ */ #include @@ -26,11 +28,10 @@ int main(int argc, char **argv){ extern char *optarg; - extern int optind; int c; int delay = 1; - page_stat_t *page_stats; + sg_page_stats *page_stats; while ((c = getopt(argc, argv, "d:")) != -1){ switch (c){ @@ -41,15 +42,15 @@ int main(int argc, char **argv){ } /* Initialise statgrab */ - statgrab_init(); + sg_init(); /* Drop setuid/setgid privileges. */ - if (statgrab_drop_privileges() != 0) { + if (sg_drop_privileges() != 0) { perror("Error. Failed to drop privileges"); return 1; } - while( (page_stats = get_page_stats_diff()) != NULL){ + while( (page_stats = sg_get_page_stats_diff()) != NULL){ printf("Pages in : %lld\n", page_stats->pages_pagein); printf("Pages out : %lld\n", page_stats->pages_pageout); sleep(delay);