---
name: "rfio_statfs"
section: "3"
platform: "linux"
package: "libdpm-dev"
version: "1.10.0-2+b3"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/rfio_statfs"
---

# rfio\_statfs(3)

get information about a mounted filesystem

## NAME

rfio\_statfs - get information about a mounted filesystem

## SYNOPSIS

**#include \<sys/types.h\>**\
 **#include "rfio\_api.h"**

**int rfio\_statfs (const char \****path***, struct rfstatfs \****statfsbuf***);**

Under Linux, for large files:\
 **#define \_LARGEFILE64\_SOURCE**\
 **#include \<sys/types.h\>**\
 **#include "rfio\_api.h"**

**int rfio\_statfs64 (const char \****path***, struct rfstatfs64 \****statfsbuf***);**

For large files, under other systems:\
 **#include \<sys/types.h\>**\
 **#include "rfio\_api.h"**

**int rfio\_statfs64 (const char \****path***, struct rfstatfs64 \****statfsbuf***);**

## DESCRIPTION

**rfio\_statfs** gets information about a mounted filesystem.

- *path*

  specifies the logical pathname relative to the current directory or the full pathname of any file in this filesystem.

- *statfsbuf*

  is a pointer to a rfstatfs structure:

  ```
  struct rfstatfs {
          long totblks  ;      /* Total number of blocks       */
          long freeblks ;      /* Number of free blocks        */
          long bsize    ;      /* Block size                   */
          long totnods  ;      /* Total number of inodes       */
          long freenods ;      /* Number of free inodes        */
  };
  struct rfstatfs64 {
          signed64 totblks  ;  /* Total number of blocks       */
          signed64 freeblks ;  /* Number of free blocks        */
          long bsize        ;  /* Block size                   */
          signed64 totnods  ;  /* Total number of inodes       */
          signed64 freenods ;  /* Number of free inodes        */
  };
  ```

The 64 bits function must be used for large filesystems. It has the same syntax as the normal statfs function except that it uses a **rfstatfs64** structure.

## RETURN VALUE

This routine returns 0 if the operation was successful or -1 if the operation failed. In the latter case, **serrno** is set appropriately.

## ERRORS

- **ENOENT**

  The named file/directory does not exist or is a null pathname.

- **EACCES**

  Search permission is denied on a component of the *path* prefix.

- **EFAULT**

  *path* or *statfsbuf* is a NULL pointer.

- **ENOTDIR**

  A component of *path* prefix is not a directory.

- **ENAMETOOLONG**

  The length of *path* exceeds **CA\_MAXPATHLEN** or the length of a *path* component exceeds **CA\_MAXNAMELEN**.

- **SENOSHOST**

  Host unknown.

- **SENOSSERV**

  Service unknown.

- **SECOMERR**

  Communication error.

## SEE ALSO

**[Castor\_limits(4)](/Castor_limits/4.md)**

## AUTHOR

**LCG Grid Deployment** Team
