Blame io/tst-statvfs.c

Packit 6c4009
#include <stdio.h>
Packit 6c4009
#include <sys/statvfs.h>
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* This test cannot detect many errors.  But it will fail if the
Packit 6c4009
   statvfs is completely hosed and it'll detect a missing export.  So
Packit 6c4009
   it is better than nothing.  */
Packit 6c4009
static int
Packit 6c4009
do_test (int argc, char *argv[])
Packit 6c4009
{
Packit 6c4009
  for (int i = 1; i < argc; ++i)
Packit 6c4009
    {
Packit 6c4009
      struct statvfs st;
Packit 6c4009
      if (statvfs (argv[i], &st) != 0)
Packit 6c4009
        printf ("%s: failed (%m)\n", argv[i]);
Packit 6c4009
      else
Packit 6c4009
        printf ("%s: free: %llu, mandatory: %s\n", argv[i],
Packit 6c4009
                (unsigned long long int) st.f_bfree,
Packit 6c4009
#ifdef ST_MANDLOCK
Packit 6c4009
                (st.f_flag & ST_MANDLOCK) ? "yes" : "no"
Packit 6c4009
#else
Packit 6c4009
                "no"
Packit 6c4009
#endif
Packit 6c4009
                );
Packit 6c4009
    }
Packit 6c4009
  return 0;
Packit 6c4009
}
Packit 6c4009
Packit 6c4009
#define TEST_FUNCTION do_test (argc, argv)
Packit 6c4009
#include "../test-skeleton.c"