beostat_get_statfs_p

Name

beostat_get_statfs_p – get file system statistics for the root file system on a node

Synopsis

#include <sys/beostat.h>
int beostat_get_statfs_p (int node, struct statfs *statfs);

Arguments

node

The node to query

statfs

A pointer to a statfs structure that will be filled upon successful completion. See the man page for statfs2 for a description of the fields.

Description

beostat_get_statfs_p executes on the master node and returns the filesystem statistics for the root filesystem on a given node.

Warning: Since Linux aggressively caches the hard disk into memory it will often appear to always be about 90% used. Some have suggested that the values of buffers and cached added together should be subtracted from the reported memory usage. However, these values may not be mutually exclusive.

Examples

statfs_p_t statfs_p;
beostat_get_statfs_p (3, &statfs_p);
printf ("The node 3 has %s bytes free\n", statfs_p.mem.free);

Return Value

Return 0 on success. If an error occurs, it will return -1.

Errors

This function relies on the Beostat subsystem, which consists of the proc filesystem on the remote node, the sendstats daemon on the remote node, the recvstats daemon on the master node, and two shared memory files in the directory /var/shm. If any part of the system breaks down, this function could fail.