Back to index

glibc  2.9
Functions | Variables
fstatfs64.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 __fstatfs64 (int fd, struct statfs64 *buf)

Variables

int __no_statfs64 attribute_hidden

Function Documentation

int __fstatfs64 ( int  fd,
struct statfs64 *  buf 
)

Definition at line 33 of file fstatfs64.c.

{
#ifdef __NR_fstatfs64
# if __ASSUME_STATFS64 == 0
  if (! __no_statfs64)
# endif
    {
      int result = INLINE_SYSCALL (fstatfs64, 3, fd, 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 (__fstatfs (fd, &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:

Here is the caller graph for this function:


Variable Documentation

int __no_statfs64 attribute_hidden

Definition at line 25 of file init-first.c.