www.delorie.com/djgpp/doc/libc/libc_364.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

fstatvfs

Syntax

 
#include <sys/types.h>
#include <sys/statvfs.h>

int fstatvfs (int fd, struct statvfs *sbuf);

Description

This function returns information about the "filesystem" (FS) containing the file referred to by the file descriptor fd and stores it in sbuf, which has the structure below:

 
struct statvfs {
  unsigned long f_bsize;   /* FS block size */
  unsigned long f_frsize;  /* fundamental block size */
  fsblkcnt_t    f_blocks;  /* # of blocks on filesystem */
  fsblkcnt_t    f_bfree;   /* # of free blocks on FS */
  fsblkcnt_t    f_bavail;  /* # of free blocks on FS for
                            * unprivileged users */
  fsfilcnt_t    f_files;   /* # of file serial numbers */
  fsfilcnt_t    f_ffree;   /* # of free file serial numbers */
  fsfilcnt_t    f_favail;  /* # of free file serial numbers
                            * for unprivileged users */
  unsigned long f_fsid;    /* FS identifier */
  unsigned long f_flag;    /* FS flags: bitwise OR of ST_NOSUID,
                            * ST_RDONLY */
  unsigned long f_namemax; /* Maximum file name length on FS */
};

Note that if INT 21h is hooked by a TSR, the total size is limited to approximately 2GB (see section statvfs).

Return Value

Zero on success, nonzero on failure (and errno set).

Portability

ANSI/ISO C No
POSIX 1003.2-1992; 1003.1-2001


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2004   by DJ Delorie     Updated Apr 2004