Back to index

glibc  2.9
statvfs.h
Go to the documentation of this file.
00001 /* Definition of `struct statvfs', information about a filesystem.
00002    Copyright (C) 1998, 2002 Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004 
00005    The GNU C Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    The GNU C Library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the GNU C Library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA.  */
00019 
00020 #ifndef _SYS_STATVFS_H
00021 # error "Never include <bits/statvfs.h> directly; use <sys/statvfs.h> instead."
00022 #endif
00023 
00024 #include <bits/types.h>
00025 
00026 /* GNU Hurd NOTE: This structure is carefully laid out such that we
00027    can use the `file_statfs' RPC to implement `statvfs' and
00028    `fstatvfs'.  Please keep this file in sync with <bits/statfs.h>,
00029    and pay attention to the note in that file.  */
00030 
00031 struct statvfs
00032   {
00033     unsigned int __f_type;
00034     unsigned int f_bsize;
00035 #ifndef __USE_FILE_OFFSET64
00036     __fsblkcnt_t f_blocks;
00037     __fsblkcnt_t f_bfree;
00038     __fsblkcnt_t f_bavail;
00039     __fsfilcnt_t f_files;
00040     __fsfilcnt_t f_ffree;
00041 #else
00042     __fsblkcnt64_t f_blocks;
00043     __fsblkcnt64_t f_bfree;
00044     __fsblkcnt64_t f_bavail;
00045     __fsfilcnt64_t f_files;
00046     __fsfilcnt64_t f_ffree;
00047 #endif
00048     __fsid_t f_fsid;
00049     unsigned int f_namemax; /* NOTE: f_namelen in `struct statfs'.  */
00050 #ifndef __USE_FILE_OFFSET64
00051     __fsfilcnt_t f_favail;
00052 #else
00053     __fsfilcnt64_t f_favail;
00054 #endif
00055     unsigned int f_frsize;
00056     unsigned int f_flag;
00057     unsigned int f_spare[3];
00058   };
00059 
00060 #ifdef __USE_LARGEFILE64
00061 struct statvfs64
00062   {
00063     unsigned int __f_type;
00064     unsigned int f_bsize;
00065     __fsblkcnt64_t f_blocks;
00066     __fsblkcnt64_t f_bfree;
00067     __fsblkcnt64_t f_bavail;
00068     __fsfilcnt64_t f_files;
00069     __fsfilcnt64_t f_ffree;
00070     __fsid_t f_fsid;
00071     unsigned int f_namemax;
00072     __fsfilcnt64_t f_favail;
00073     unsigned int f_frsize;
00074     unsigned int f_flag;
00075     unsigned int f_spare[3];
00076   };
00077 #endif
00078 
00079 /* Definitions for the flag in `f_flag'.
00080    The values for the non-standard flags come from Linux.  */
00081 enum
00082 {
00083   ST_RDONLY = 1,
00084 #define ST_RDONLY    ST_RDONLY
00085   ST_NOSUID = 2
00086 #define ST_NOSUID    ST_NOSUID
00087 #ifdef __USE_GNU
00088   ,
00089   ST_NOEXEC = 8,
00090 # define ST_NOEXEC   ST_NOEXEC
00091   ST_SYNCHRONOUS = 16
00092 # define ST_SYNCHRONOUS     ST_SYNCHRONOUS
00093 #endif
00094 };