--- projects/libstatgrab/examples/vm_stats.c 2004/01/16 15:54:52 1.6 +++ projects/libstatgrab/examples/vm_stats.c 2004/04/04 22:48:49 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: vm_stats.c,v 1.8 2004/04/04 22:48:49 tdb Exp $ */ #include @@ -25,24 +27,11 @@ int main(int argc, char **argv){ - extern char *optarg; - extern int optind; - int c; - - int delay = 1; mem_stat_t *mem_stats; swap_stat_t *swap_stats; long long total, free; - while ((c = getopt(argc, argv, "d:")) != -1){ - switch (c){ - case 'd': - delay = atoi(optarg); - break; - } - } - /* Initialise statgrab */ statgrab_init(); @@ -67,6 +56,10 @@ int main(int argc, char **argv){ printf("Total VM usage : %5.2f%%\n", 100 - (((float)total/(float)free))); + } + else { + printf("Unable to get VM stats.\n"); + exit(1); } exit(0); }