Back to index

glibc  2.9
statvfs.h
Go to the documentation of this file.
00001 /* Copyright (C) 1997,1998,2000,2001,2002,2006 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003 
00004    The GNU C Library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Lesser General Public
00006    License as published by the Free Software Foundation; either
00007    version 2.1 of the License, or (at your option) any later version.
00008 
00009    The GNU C Library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Lesser General Public License for more details.
00013 
00014    You should have received a copy of the GNU Lesser General Public
00015    License along with the GNU C Library; if not, write to the Free
00016    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00017    02111-1307 USA.  */
00018 
00019 #ifndef _SYS_STATVFS_H
00020 # error "Never include <bits/statvfs.h> directly; use <sys/statvfs.h> instead."
00021 #endif
00022 
00023 #include <bits/types.h>  /* For __fsblkcnt_t and __fsfilcnt_t.  */
00024 
00025 #if __WORDSIZE == 32
00026 #define _STATVFSBUF_F_UNUSED
00027 #endif
00028 
00029 struct statvfs
00030   {
00031     unsigned long int f_bsize;
00032     unsigned long int f_frsize;
00033 #ifndef __USE_FILE_OFFSET64
00034     __fsblkcnt_t f_blocks;
00035     __fsblkcnt_t f_bfree;
00036     __fsblkcnt_t f_bavail;
00037     __fsfilcnt_t f_files;
00038     __fsfilcnt_t f_ffree;
00039     __fsfilcnt_t f_favail;
00040 #else
00041     __fsblkcnt64_t f_blocks;
00042     __fsblkcnt64_t f_bfree;
00043     __fsblkcnt64_t f_bavail;
00044     __fsfilcnt64_t f_files;
00045     __fsfilcnt64_t f_ffree;
00046     __fsfilcnt64_t f_favail;
00047 #endif
00048     unsigned long int f_fsid;
00049 #ifdef _STATVFSBUF_F_UNUSED
00050     int __f_unused;
00051 #endif
00052     unsigned long int f_flag;
00053     unsigned long int f_namemax;
00054     int __f_spare[6];
00055   };
00056 
00057 #ifdef __USE_LARGEFILE64
00058 struct statvfs64
00059   {
00060     unsigned long int f_bsize;
00061     unsigned long int f_frsize;
00062     __fsblkcnt64_t f_blocks;
00063     __fsblkcnt64_t f_bfree;
00064     __fsblkcnt64_t f_bavail;
00065     __fsfilcnt64_t f_files;
00066     __fsfilcnt64_t f_ffree;
00067     __fsfilcnt64_t f_favail;
00068     unsigned long int f_fsid;
00069 #ifdef _STATVFSBUF_F_UNUSED
00070     int __f_unused;
00071 #endif
00072     unsigned long int f_flag;
00073     unsigned long int f_namemax;
00074     int __f_spare[6];
00075   };
00076 #endif
00077 
00078 /* Definitions for the flag in `f_flag'.  These definitions should be
00079    kept in sync with the definitions in <sys/mount.h>.  */
00080 enum
00081 {
00082   ST_RDONLY = 1,            /* Mount read-only.  */
00083 #define ST_RDONLY    ST_RDONLY
00084   ST_NOSUID = 2                    /* Ignore suid and sgid bits.  */
00085 #define ST_NOSUID    ST_NOSUID
00086 #ifdef __USE_GNU
00087   ,
00088   ST_NODEV = 4,                    /* Disallow access to device special files.  */
00089 # define ST_NODEV    ST_NODEV
00090   ST_NOEXEC = 8,            /* Disallow program execution.  */
00091 # define ST_NOEXEC   ST_NOEXEC
00092   ST_SYNCHRONOUS = 16,             /* Writes are synced at once.  */
00093 # define ST_SYNCHRONOUS     ST_SYNCHRONOUS
00094   ST_MANDLOCK = 64,         /* Allow mandatory locks on an FS.  */
00095 # define ST_MANDLOCK ST_MANDLOCK
00096   ST_WRITE = 128,           /* Write on file/directory/symlink.  */
00097 # define ST_WRITE    ST_WRITE
00098   ST_APPEND = 256,          /* Append-only file.  */
00099 # define ST_APPEND   ST_APPEND
00100   ST_IMMUTABLE = 512,              /* Immutable file.  */
00101 # define ST_IMMUTABLE       ST_IMMUTABLE
00102   ST_NOATIME = 1024,        /* Do not update access times.  */
00103 # define ST_NOATIME  ST_NOATIME
00104   ST_NODIRATIME = 2048,            /* Do not update directory access times.  */
00105 # define ST_NODIRATIME      ST_NODIRATIME
00106   ST_RELATIME = 4096        /* Update atime relative to mtime/ctime.  */
00107 # define ST_RELATIME ST_RELATIME
00108 #endif /* Use GNU.  */
00109 };