OSDN Git Service

(split) LDP: Update original to LDP v3.65
[linuxjm/LDP_man-pages.git] / original / man2 / statfs.2
index f6e3149..854a7da 100644 (file)
@@ -1,5 +1,6 @@
 .\" Copyright (C) 2003 Andries Brouwer (aeb@cwi.nl)
 .\"
+.\" %%%LICENSE_START(VERBATIM)
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
 .\" Modified 2003-08-17 by Walter Harms
 .\" Modified 2004-06-23 by Michael Kerrisk <mtk.manpages@gmail.com>
 .\"
-.TH STATFS 2 2010-09-04 "Linux" "Linux Programmer's Manual"
+.TH STATFS 2 2010-11-21 "Linux" "Linux Programmer's Manual"
 .SH NAME
-statfs, fstatfs \- get file system statistics
+statfs, fstatfs \- get filesystem statistics
 .SH SYNOPSIS
 .BR "#include <sys/vfs.h>    " "/* or <sys/statfs.h> */"
 .sp
@@ -35,9 +37,9 @@ statfs, fstatfs \- get file system statistics
 .SH DESCRIPTION
 The function
 .BR statfs ()
-returns information about a mounted file system.
+returns information about a mounted filesystem.
 .I path
-is the pathname of any file within the mounted file system.
+is the pathname of any file within the mounted filesystem.
 .I buf
 is a pointer to a
 .I statfs
@@ -52,21 +54,21 @@ structure defined approximately as follows:
 #endif
 
 struct statfs {
-    __SWORD_TYPE f_type;    /* type of file system (see below) */
+    __SWORD_TYPE f_type;    /* type of filesystem (see below) */
     __SWORD_TYPE f_bsize;   /* optimal transfer block size */
-    fsblkcnt_t   f_blocks;  /* total data blocks in file system */
+    fsblkcnt_t   f_blocks;  /* total data blocks in filesystem */
     fsblkcnt_t   f_bfree;   /* free blocks in fs */
     fsblkcnt_t   f_bavail;  /* free blocks available to
                                unprivileged user */
-    fsfilcnt_t   f_files;   /* total file nodes in file system */
+    fsfilcnt_t   f_files;   /* total file nodes in filesystem */
     fsfilcnt_t   f_ffree;   /* free file nodes in fs */
-    fsid_t       f_fsid;    /* file system id */
+    fsid_t       f_fsid;    /* filesystem id */
     __SWORD_TYPE f_namelen; /* maximum length of filenames */
     __SWORD_TYPE f_frsize;  /* fragment size (since Linux 2.6) */
     __SWORD_TYPE f_spare[5];
 };
 
-File system types:
+Filesystem types:
 
    ADFS_SUPER_MAGIC      0xadf5
    AFFS_SUPER_MAGIC      0xADFF
@@ -120,11 +122,11 @@ Nobody knows what
 .I f_fsid
 is supposed to contain (but see below).
 .PP
-Fields that are undefined for a particular file system are set to 0.
+Fields that are undefined for a particular filesystem are set to 0.
 .BR fstatfs ()
 returns the same information about an open file referenced by descriptor
 .IR fd .
-.SH "RETURN VALUE"
+.SH RETURN VALUE
 On success, zero is returned.
 On error, \-1 is returned, and
 .I errno
@@ -153,7 +155,7 @@ points to an invalid address.
 This call was interrupted by a signal.
 .TP
 .B EIO
-An I/O error occurred while reading from the file system.
+An I/O error occurred while reading from the filesystem.
 .TP
 .B ELOOP
 .RB ( statfs ())
@@ -175,7 +177,7 @@ does not exist.
 Insufficient kernel memory was available.
 .TP
 .B ENOSYS
-The file system does not support this call.
+The filesystem does not support this call.
 .TP
 .B ENOTDIR
 .RB ( statfs ())
@@ -185,20 +187,34 @@ is not a directory.
 .TP
 .B EOVERFLOW
 Some values were too large to be represented in the returned struct.
-.SH "CONFORMING TO"
+.SH CONFORMING TO
 Linux-specific.
 The Linux
 .BR statfs ()
 was inspired by the 4.4BSD one
 (but they do not use the same structure).
 .SH NOTES
-The kernel has system calls
-.BR statfs (),
-.BR fstatfs (),
-.BR statfs64 (),
+The original Linux
+.BR statfs ()
+and
+.BR fstatfs ()
+system calls were not designed with extremely large file sizes in mind.
+Subsequently, Linux 2.6
+added new
+.BR statfs64 ()
 and
 .BR fstatfs64 ()
-to support this library call.
+system calls that employ a new structure,
+.IR statfs64 .
+The new structure contains the same fields as the original
+.I statfs
+structure, but the sizes of various fields are increased,
+to accommodate large file sizes.
+The glibc
+.BR statfs ()
+and
+.BR fstatfs ()
+wrapper functions transparently deal with the kernel differences.
 
 Some systems only have \fI<sys/vfs.h>\fP, other systems also have
 \fI<sys/statfs.h>\fP, where the former includes the latter.
@@ -246,11 +262,11 @@ contains some random stuff such that the pair
 .RI ( f_fsid , ino )
 uniquely determines a file.
 Some operating systems use (a variation on) the device number, or the device number
-combined with the file-system type.
+combined with the filesystem type.
 Several OSes restrict giving out the
 .I f_fsid
 field to the superuser only (and zero it for unprivileged users),
-because this field is used in the filehandle of the file system
+because this field is used in the filehandle of the filesystem
 when NFS-exported, and giving it out is a security concern.
 .LP
 Under some operating systems the
@@ -258,7 +274,15 @@ Under some operating systems the
 can be used as second argument to the
 .BR sysfs (2)
 system call.
-.SH "SEE ALSO"
+.SH SEE ALSO
 .BR stat (2),
 .BR statvfs (2),
 .BR path_resolution (7)
+.SH COLOPHON
+This page is part of release 3.65 of the Linux
+.I man-pages
+project.
+A description of the project,
+and information about reporting bugs,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.