--- projects/libstatgrab/src/libstatgrab/statgrab.h 2003/02/19 17:13:24 1.4 +++ projects/libstatgrab/src/libstatgrab/statgrab.h 2003/11/11 10:27:04 1.17 @@ -1,7 +1,7 @@ /* * i-scream central monitoring system - * http://www.i-scream.org.uk - * Copyright (C) 2000-2002 i-scream + * http://www.i-scream.org + * Copyright (C) 2000-2003 i-scream * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -19,15 +19,21 @@ */ #include +#ifdef NETBSD +#include +#endif +#ifdef CYGWIN +#include +#endif typedef struct{ - uint_t user; - uint_t kernel; - uint_t idle; - uint_t iowait; - uint_t swap; - uint_t nice; - uint_t total; + long long user; + long long kernel; + long long idle; + long long iowait; + long long swap; + long long nice; + long long total; time_t systime; }cpu_states_t; @@ -57,11 +63,18 @@ typedef struct{ #ifdef SOLARIS #define MAX_LOGIN_NAME_SIZE 8 #endif +#if defined(LINUX) || defined(FREEBSD) +#define MAX_LOGIN_NAME_SIZE UT_NAMESIZE +#endif +#ifdef NETBSD +#define MAX_LOGIN_NAME_SIZE _POSIX_LOGIN_NAME_MAX +#endif +#if defined(CYGWIN) +#define MAX_LOGIN_NAME_SIZE _SC_LOGIN_NAME_MAX +#endif -typedef char name[MAX_LOGIN_NAME_SIZE+1]; - typedef struct{ - name *name_list; + char *name_list; int num_entries; }user_stat_t; @@ -115,8 +128,6 @@ typedef struct{ }network_stat_t; typedef struct{ - long long num_pagein; - long long num_pageout; long long pages_pagein; long long pages_pageout; time_t systime; @@ -137,6 +148,8 @@ swap_stat_t *get_swap_stats(); general_stat_t *get_general_stats(); disk_stat_t *get_disk_stats(int *entries); +diskio_stat_t *get_diskio_stats(int *entries); +diskio_stat_t *get_diskio_stats_diff(int *entries); process_stat_t *get_process_stats(); @@ -145,3 +158,5 @@ network_stat_t *get_network_stats_diff(int *entries); page_stat_t *get_page_stats(); page_stat_t *get_page_stats_diff(); + +int statgrab_init(void);