Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ statfs(2) — DG/UX R4.11

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

chmod(2)

chown(2)

creat(2)

fchmod(2)

fchown(2)

fstatfs(2)

link(2)

mknod(2)

pipe(2)

read(2)

time(2)

times(2)

ustat(2)

write(2)

fs(4)



statfs(2)                         SDK R4.11                        statfs(2)


NAME
       statfs - get information about a mounted file system

SYNOPSIS
       #include <sys/types.h>
       #include <sys/statfs.h>

       int  statfs (pathname, statfsbuffer, len, fstype)
       char * pathname;
       struct statfs * statfsbuffer;
       int    len;
       int    fstype;

   where:
       pathname       Address of a pathname

       statfsbuffer  Where information about the file system is returned

       len            Length of the statfs structure

       fstype         0 (to return the file system statistics for the file
                      system containing the file named by pathname) or
                      nonzero (to return the file system statistics for the
                      file system that resides on the file system device
                      named by pathname)

DESCRIPTION
       If fstype is 0, statfs returns information about the mounted file
       system that contains the file named by pathname.  Otherwise, statfs
       returns information about the file system residing on the device
       named by pathname.  Terminal symbolic links are followed.  The
       statistics returned in the statfs structure include:

       short ffstyp       The type of file system.
       long  fbsize       The block size of the file system, in bytes.
       long  ffrsize      The fragment size of the file system, in bytes.
       long  fblocks      The maximum number of blocks that may exist in
                           the control point directory containing the
                           pathname passed to statfs, taking into account
                           the block limits of all CPDs on the path.  If the
                           pathname is a CPD, its own block limit is also
                           taken into account.  If the pathname is the root
                           of a file system, this field is the maximum that
                           applies to users with an effective UID of 0
                           (root) on a traditionsl DG/UX system. If the
                           pathname is not a file system root, fblocks is
                           the maximum that applies to all users.
       long  fbfree       The number of free blocks in the control-point
                           directory containing the pathname passed to
                           statfs, taking into account the block limits of
                           all CPDs on the path. If the pathname is a CPD,
                           its own block limit is also taken into account.
                           If the pathname is the root of a file system,
                           this field is the number of blocks that can still
                           be allocated by a user with an effective UID of 0
                           (root) in a traditional DG/UX system.  If the
                           pathname is not a file system root, the free
                           count applies to all users.
       long  ffiles       The total number of files that may exist in the
                           control- point directory containing the pathname
                           passed to statfs, i.e. the number allocated plus
                           the number that still may be created, taking into
                           account the file limits of all CPDs on the path.
                           If the pathname is a CPD, its own file limit is
                           also taken into account. If the pathname is the
                           root of a file system, this field is the maximum
                           that applies to users with an effective UID of 0
                           (root) in a traditional DG/UX system.  If the
                           pathname is not a file system root, the maximum
                           applies to all users.
       long  fffree       The number of files that still may be created in
                           the control-point directory containing the
                           pathname passed to statfs, taking into account
                           the file limits of all CPDs on the path.  If the
                           pathname is a CPD, its own file limit is also
                           taken into account.  If the pathname is the root
                           of a file system, this field is the number of
                           files that can still be created by users with an
                           effective UID of 0 (root).  If the pathname is
                           not a file system root, the file count applies to
                           all users.
       char  ffname[6]    The file system name. This field will be null
                           unless a label has been added to it with labelit.
       char  ffpack[6]    The file system pack name. This field will be
                           null unless a label has been added to it with
                           labelit.


       Additional fields may be available based on the target environment
       being compiled for. See /usr/include/sys/statfs.h for more details.
       Most DG/UX systems will also support the following fields:

       long  fbavail      The number of free blocks on the file system
                           available to users that lack the priviledges
                           traditionally associated with users that have an
                           effective UID of 0 (root) on a DG/UX system.
       long  ffavail      The number of files that still may be created on
                           the file system by users that lack the privileges
                           traditionally associated with users that have an
                           effective UID of 0 (root) on a DG/UX system.
       long  fsblocks     The file system size, in blocks.
       long  fsbfree      The total number of free blocks on the file
                           system.
       long  fsbavail     The number of free blocks on the file system
                           available to users that lack the priviledges
                           traditionally associated with users that have an
                           effective UID of 0 (root) on a DG/UX system.
       long  fsfiles      The total number of files that may exist on the
                           file system, i.e. the number allocated plus the
                           number that still may be created.
       long  fsffree      The number of files that still may be created on
                           the file system.
       long  fsfavail     The number of files that still may be created on
                           the file system by users that lack the
                           priviledges traditionally associated with users
                           that have an effective UID of 0 (root) on a DG/UX
                           system.


       Fields that are undefined for a particular file system are set to -1.

ACCESS CONTROL
       None.

RETURN VALUE
       0      The file system information was successfully returned.

       -1     An error occurred.  errno is set to indicate the error.

DIAGNOSTICS
       Errno may be set to one of the following error codes:

       EFAULT         Some part of the statfs structure pointed to by
                      statfsbuffer lies outside of the process's writable
                      address space.

       ENOENT         The named file does not exist.

       ENOENT         A non-terminal component of the pathname does not
                      exist.

       ENOTDIR        A non-terminal component of the pathname was not a
                      directory or symbolic link.

       ENAMETOOLONG   The pathname exceeds the length limit for pathnames.

       ENAMETOOLONG   A component of the pathname exceeds the length limit
                      for filenames.

       ENOMEM         There are not enough system resources to resolve the
                      pathname or to expand a symbolic link.

       ELOOP          The number of symbolic links encountered during
                      pathname resolution exceeded MAXSYMLINKS.  A symbolic
                      link cycle is suspected.

       EPERM          The pathname contains a character not in the allowed
                      character set.

       EFAULT         The pathname does not completely reside in the
                      process's address space or the pathname does not
                      terminate in the process's address space.

       EINVAL         Fstype was nonzero and pathname did not name a block
                      special device.

FILES
       /usr/include/sys/statfs.h

SEE ALSO
       chmod(2), chown(2), creat(2), fchmod(2), fchown(2), fstatfs(2),
       link(2), mknod(2), pipe(2), read(2), time(2), times(2), ustat(2),
       write(2), fs(4).


Licensed material--property of copyright holder(s)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026