--- projects/libstatgrab/examples/process_stats.c 2004/01/19 16:49:19 1.7 +++ projects/libstatgrab/examples/process_stats.c 2004/04/05 16:23:08 1.9 @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * $Id: process_stats.c,v 1.7 2004/01/19 16:49:19 tdb Exp $ + * $Id: process_stats.c,v 1.9 2004/04/05 16:23:08 tdb Exp $ */ #include @@ -28,11 +28,10 @@ int main(int argc, char **argv){ extern char *optarg; - extern int optind; int c; int delay = 1; - process_stat_t *process_stat; + sg_process_count *process_stat; while ((c = getopt(argc, argv, "d:")) != -1){ switch (c){ @@ -43,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( (process_stat = get_process_stats()) != NULL){ + while( (process_stat = sg_get_process_count()) != NULL){ printf("Running:%3d \t", process_stat->running); printf("Sleeping:%5d \t",process_stat->sleeping); printf("Stopped:%4d \t", process_stat->stopped);