Back to index

glibc  2.9
Functions | Variables
statfs64.c File Reference
#include <errno.h>
#include <string.h>
#include <sys/statfs.h>
#include <stddef.h>
#include <sysdep.h>
#include <kernel-features.h>

Go to the source code of this file.

Functions

int __statfs64 (const char *file, struct statfs64 *buf)

Variables

int __no_statfs64 attribute_hidden

Function Documentation

int __statfs64 ( const char *  file,
struct statfs64 *  buf 
)

Definition at line 34 of file statfs64.c.

{
#ifdef __NR_statfs64
# if __ASSUME_STATFS64 == 0
  if (! __no_statfs64)
# endif
    {
      int result = INLINE_SYSCALL (statfs64, 3, file, sizeof (*buf), buf);

# if __ASSUME_STATFS64 == 0
      if (result == 0 || errno != ENOSYS)
# endif
       return result;

# if __ASSUME_STATFS64 == 0
      __no_statfs64 = 1;
# endif
    }
#endif

#if __ASSUME_STATFS64 == 0
  struct statfs buf32;

  if (__statfs (file, &buf32) < 0)
    return -1;

  buf->f_type = buf32.f_type;
  buf->f_bsize = buf32.f_bsize;
  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_fsid = buf32.f_fsid;
  buf->f_namelen = buf32.f_namelen;
  buf->f_frsize = buf32.f_frsize;
  memcpy (buf->f_spare, buf32.f_spare, sizeof (buf32.f_spare));

  return 0;
#endif
}

Here is the call graph for this function:


Variable Documentation

int __no_statfs64 attribute_hidden

Definition at line 29 of file statfs64.c.