beostat_get_statfs_p – get file system statistics for the root file system on a node
#include <sys/beostat.h> int beostat_get_statfs_p (int node, struct statfs *statfs);
The node to query
A pointer to a
statfsstructure that will be filled upon successful completion. See the man page for statfs2 for a description of the fields.
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
cached added together should be
subtracted from the reported memory usage. However, these values may not
be mutually exclusive.
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 0 on success. If an error occurs, it will return -1.
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.