// future additions go here, please
};
-struct procps_statinfo {
+struct procps_stat {
int refcount;
int stat_fd;
struct stat_data data;
* 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;
* 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];
}
PROCPS_EXPORT int procps_stat_ref (
- struct procps_statinfo *info)
+ struct procps_stat *info)
{
if (info == NULL)
return -EINVAL;
}
PROCPS_EXPORT int procps_stat_unref (
- struct procps_statinfo **info)
+ struct procps_stat **info)
{
if (info == NULL || *info == NULL)
return -EINVAL;
}
PROCPS_EXPORT jiff procps_stat_get_cpu (
- struct procps_statinfo *info,
+ struct procps_stat *info,
enum procps_cpu_item item)
{
switch (item) {
}
PROCPS_EXPORT int procps_get_cpu_chain (
- struct procps_statinfo *info,
+ struct procps_stat *info,
struct procps_cpu_result *item)
{
if (item == NULL)
}
PROCPS_EXPORT unsigned int procps_stat_get_sys (
- struct procps_statinfo *info,
+ struct procps_stat *info,
enum procps_stat_item item)
{
switch (item) {
}
PROCPS_EXPORT int procps_stat_get_sys_chain (
- struct procps_statinfo *info,
+ struct procps_stat *info,
struct procps_sys_result *item)
{
if (item == NULL)
* 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;
* 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)
{
* 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)
{
* 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)
{
* 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)
{
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
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);
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;
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,