/* compile gcc -o vfsf vfs.c*/
/* proof of concept code for net-snmp www.net-snmp.org
may be used under same license agreement*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/statvfs.h>
main()
{
struct statvfs vfs;
if (statvfs("/dev/dsk/c0t0d0s7",&vfs) == -1)
printf("partition lookup failed\n");
else
{
printf("size = %d, blocks = %d free = %d\n",
vfs.f_frsize, vfs.f_blocks, vfs.f_bfree);
} /*end if*/
if (statvfs("/dev/dsk/c0t9d0s6",&vfs) == -1)
printf("partition lookup failed\n");
else
{
printf("size = %d, blocks = %d free = %d\n",
vfs.f_frsize, vfs.f_blocks, vfs.f_bfree);
} /*end if*/
} /* end vfs.c */
No matter what partitions I use, I get the same bogus results
size = 1024, blocks = 1018382 free = 283265
I've also tried using LARGEFILE support. It just makes matters worse.
Then I get
size = 1024 blocks = 0 free = 1018382
This communication is intended for the use of the recipient to which it is addressed, and may contain confidential, personal and or privileged information. Please contact us immediately if you are not the intended recipient of this communication, and do not copy, distribute, or take action relying on it. Any communication received in error, or subsequent reply, should be deleted or destroyed.
