Back to index

glibc  2.9
Functions
fstatvfs64.c File Reference
#include <errno.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/statfs.h>
#include <sys/statvfs.h>
#include <kernel-features.h>

Go to the source code of this file.

Functions

void __internal_statvfs64 (const char *name, struct statvfs64 *buf, struct statfs64 *fsbuf, struct stat64 *st)
int __fstatvfs64 (int fd, struct statvfs64 *buf)

Function Documentation

int __fstatvfs64 ( int  fd,
struct statvfs64 buf 
)

Definition at line 35 of file fstatvfs64.c.

{
  struct statfs64 fsbuf;
  int res = __fstatfs64 (fd, &fsbuf);

#ifndef __ASSUME_STATFS64
  if (res < 0 && errno == ENOSYS)
    {
      struct statvfs buf32;

      res = fstatvfs (fd, &buf32);
      if (res == 0)
       {
         buf->f_bsize = buf32.f_bsize;
         buf->f_frsize = buf32.f_frsize;
         buf->f_blocks = buf32.f_blocks;
         buf->f_bfree = buf32.f_bfree;
         buf->f_bavail = buf32.f_bavail;
         buf->f_files = buf32.f_files;
         buf->f_ffree = buf32.f_ffree;
         buf->f_favail = buf32.f_favail;
         buf->f_fsid = buf32.f_fsid;
         buf->f_flag = buf32.f_flag;
         buf->f_namemax = buf32.f_namemax;
         memcpy (buf->__f_spare, buf32.__f_spare, sizeof (buf32.__f_spare));
       }
    }
#endif

  if (res == 0)
    {
      /* Convert the result.  */
      struct stat64 st;
      __internal_statvfs64 (NULL, buf, &fsbuf,
                         fstat64 (fd, &st) == -1 ? NULL : &st);
    }

  return res;
}

Here is the call graph for this function:

void __internal_statvfs64 ( const char *  name,
struct statvfs64 buf,
struct statfs64 *  fsbuf,
struct stat64 st 
)

Here is the caller graph for this function: