diff --git a/proc/readstat.c b/proc/readstat.c index 6af84f41..64ca2324 100644 --- a/proc/readstat.c +++ b/proc/readstat.c @@ -27,7 +27,7 @@ struct procps_jiffs_private { // future additions go here, please }; -struct procps_statinfo { +struct procps_stat { int refcount; int stat_fd; struct stat_data data; @@ -49,10 +49,10 @@ struct procps_statinfo { * Returns: a new stat info container */ PROCPS_EXPORT int procps_stat_new ( - struct procps_statinfo **info) + struct procps_stat **info) { - struct procps_statinfo *v; - v = calloc(1, sizeof(struct procps_statinfo)); + struct procps_stat *v; + v = calloc(1, sizeof(struct procps_stat)); if (!v) return -ENOMEM; @@ -73,7 +73,7 @@ PROCPS_EXPORT int procps_stat_new ( * If CPU stats only needed, set cpu_only to non-zero */ PROCPS_EXPORT int procps_stat_read ( - struct procps_statinfo *info, + struct procps_stat *info, const int cpu_only) { char buf[8192]; @@ -153,7 +153,7 @@ PROCPS_EXPORT int procps_stat_read ( } PROCPS_EXPORT int procps_stat_ref ( - struct procps_statinfo *info) + struct procps_stat *info) { if (info == NULL) return -EINVAL; @@ -162,7 +162,7 @@ PROCPS_EXPORT int procps_stat_ref ( } PROCPS_EXPORT int procps_stat_unref ( - struct procps_statinfo **info) + struct procps_stat **info) { if (info == NULL || *info == NULL) return -EINVAL; @@ -178,7 +178,7 @@ PROCPS_EXPORT int procps_stat_unref ( } PROCPS_EXPORT jiff procps_stat_get_cpu ( - struct procps_statinfo *info, + struct procps_stat *info, enum procps_cpu_item item) { switch (item) { @@ -207,7 +207,7 @@ PROCPS_EXPORT jiff procps_stat_get_cpu ( } PROCPS_EXPORT int procps_get_cpu_chain ( - struct procps_statinfo *info, + struct procps_stat *info, struct procps_cpu_result *item) { if (item == NULL) @@ -255,7 +255,7 @@ PROCPS_EXPORT int procps_get_cpu_chain ( } PROCPS_EXPORT unsigned int procps_stat_get_sys ( - struct procps_statinfo *info, + struct procps_stat *info, enum procps_stat_item item) { switch (item) { @@ -276,7 +276,7 @@ PROCPS_EXPORT unsigned int procps_stat_get_sys ( } PROCPS_EXPORT int procps_stat_get_sys_chain ( - struct procps_statinfo *info, + struct procps_stat *info, struct procps_sys_result *item) { if (item == NULL) @@ -324,7 +324,7 @@ PROCPS_EXPORT int procps_stat_get_sys_chain ( * supplied structures upon request. */ PROCPS_EXPORT int procps_stat_read_jiffs ( - struct procps_statinfo *info) + struct procps_stat *info) { #define ALLOCincr 32 struct procps_jiffs_private *sum_ptr, *cpu_ptr; @@ -413,7 +413,7 @@ reap_em_again: * This function deals only with the 'current' jiffs counts. */ PROCPS_EXPORT int procps_stat_get_jiffs ( - struct procps_statinfo *info, + struct procps_stat *info, struct procps_jiffs *item, int which) { @@ -451,7 +451,7 @@ PROCPS_EXPORT int procps_stat_get_jiffs ( * This function deals only with the 'current' jiffs counts. */ PROCPS_EXPORT int procps_stat_get_jiffs_all ( - struct procps_statinfo *info, + struct procps_stat *info, struct procps_jiffs *item, int numitems) { @@ -477,7 +477,7 @@ PROCPS_EXPORT int procps_stat_get_jiffs_all ( * This function provides both 'new' and 'old' jiffs counts. */ PROCPS_EXPORT int procps_stat_get_jiffs_hist ( - struct procps_statinfo *info, + struct procps_stat *info, struct procps_jiffs_hist *item, int which) { @@ -513,7 +513,7 @@ PROCPS_EXPORT int procps_stat_get_jiffs_hist ( * This function provides both 'new' and 'old' jiffs counts. */ PROCPS_EXPORT int procps_stat_get_jiffs_hist_all ( - struct procps_statinfo *info, + struct procps_stat *info, struct procps_jiffs_hist *item, int numitems) { diff --git a/proc/readstat.h b/proc/readstat.h index 902f5ee3..5904a803 100644 --- a/proc/readstat.h +++ b/proc/readstat.h @@ -68,24 +68,24 @@ struct procps_sys_result { struct procps_sys_result *next; }; -struct procps_statinfo; +struct procps_stat; -int procps_stat_new (struct procps_statinfo **info); -int procps_stat_read (struct procps_statinfo *info, const int cpu_only); -int procps_stat_read_jiffs (struct procps_statinfo *info); +int procps_stat_new (struct procps_stat **info); +int procps_stat_read (struct procps_stat *info, const int cpu_only); +int procps_stat_read_jiffs (struct procps_stat *info); -int procps_stat_ref (struct procps_statinfo *info); -int procps_stat_unref (struct procps_statinfo **info); +int procps_stat_ref (struct procps_stat *info); +int procps_stat_unref (struct procps_stat **info); -jiff procps_stat_get_cpu (struct procps_statinfo *info, enum procps_cpu_item item); -int procps_stat_get_cpu_chain (struct procps_statinfo *info, struct procps_cpu_result *item); -int procps_stat_get_jiffs (struct procps_statinfo *info, struct procps_jiffs *item, int which); -int procps_stat_get_jiffs_all (struct procps_statinfo *info, struct procps_jiffs *item, int numitems); -int procps_stat_get_jiffs_hist (struct procps_statinfo *info, struct procps_jiffs_hist *item, int which); -int procps_stat_get_jiffs_hist_all (struct procps_statinfo *info, struct procps_jiffs_hist *item, int numitems); +jiff procps_stat_get_cpu (struct procps_stat *info, enum procps_cpu_item item); +int procps_stat_get_cpu_chain (struct procps_stat *info, struct procps_cpu_result *item); +int procps_stat_get_jiffs (struct procps_stat *info, struct procps_jiffs *item, int which); +int procps_stat_get_jiffs_all (struct procps_stat *info, struct procps_jiffs *item, int numitems); +int procps_stat_get_jiffs_hist (struct procps_stat *info, struct procps_jiffs_hist *item, int which); +int procps_stat_get_jiffs_hist_all (struct procps_stat *info, struct procps_jiffs_hist *item, int numitems); -unsigned int procps_stat_get_sys (struct procps_statinfo *info, enum procps_stat_item item); -int procps_stat_get_sys_chain (struct procps_statinfo *info, struct procps_sys_result *item); +unsigned int procps_stat_get_sys (struct procps_stat *info, enum procps_stat_item item); +int procps_stat_get_sys_chain (struct procps_stat *info, struct procps_sys_result *item); __END_DECLS #endif diff --git a/ps/output.c b/ps/output.c index 72be9235..c8da63cb 100644 --- a/ps/output.c +++ b/ps/output.c @@ -98,7 +98,7 @@ extern long Hertz; static void get_boot_time(void) { - struct procps_statinfo *sys_info; + struct procps_stat *sys_info; if (procps_stat_new(&sys_info) < 0) xerrx(EXIT_FAILURE, _("Unable to create system stat structure")); diff --git a/top/top.c b/top/top.c index d0a691dc..e46cf50b 100644 --- a/top/top.c +++ b/top/top.c @@ -269,7 +269,7 @@ enum mem_enums { }; #define MEM_VAL(e) mem_chain[e].result -static struct procps_statinfo *sys_info; +static struct procps_stat *sys_info; static struct procps_jiffs_hist *Cpu_jiffs; /*###### Sort callbacks ################################################*/ diff --git a/vmstat.c b/vmstat.c index 5365b456..a469e7d2 100644 --- a/vmstat.c +++ b/vmstat.c @@ -298,7 +298,7 @@ static void new_format(void) time_t the_time; char timebuf[32]; struct procps_vmstat *vm_info; - struct procps_statinfo *sys_info; + struct procps_stat *sys_info; struct procps_meminfo *mem_info; sleep_half = (sleep_time / 2); @@ -837,7 +837,7 @@ static void disksum_format(void) static void sum_format(void) { - struct procps_statinfo *sys_info; + struct procps_stat *sys_info; struct procps_vmstat *vm_info; struct procps_meminfo *mem_info; @@ -896,7 +896,7 @@ static void sum_format(void) static void fork_format(void) { - struct procps_statinfo *sys_info; + struct procps_stat *sys_info; if (procps_stat_new(&sys_info) < 0) xerrx(EXIT_FAILURE,