diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2005-02-23 13:12:43 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2005-02-23 13:12:43 +0000 |
commit | a652e6d52a0d403bc8ffebfc1a83e305eff42d2c (patch) | |
tree | cb4d4fc7dc0fb7a9ca21e229d1b60b370f026daa /winsup/cygwin/include | |
parent | e5ef74dfb2c6b8e00daf6afc7ac8895c626a59d9 (diff) | |
download | cygnal-a652e6d52a0d403bc8ffebfc1a83e305eff42d2c.tar.gz cygnal-a652e6d52a0d403bc8ffebfc1a83e305eff42d2c.tar.bz2 cygnal-a652e6d52a0d403bc8ffebfc1a83e305eff42d2c.zip |
* cygwin.din (fstatvfs): Export.
(statvfs): Export.
* syscalls.cc: Include sys/statvfs.h.
(statvfs): New function. Move statfs functionality here.
(fstatvfs): New function.
(statfs): Just call statvfs and copy structure. Check validity of
incoming struct statfs pointer.
* include/cygwin/types.h (fsblkcnt_t): Define.
(fsfilcnt_t): Define.
* include/cygwin/version.h: Bump API minor version.
* include/sys/statvfs.h: New file.
Diffstat (limited to 'winsup/cygwin/include')
-rw-r--r-- | winsup/cygwin/include/cygwin/types.h | 10 | ||||
-rw-r--r-- | winsup/cygwin/include/cygwin/version.h | 3 | ||||
-rw-r--r-- | winsup/cygwin/include/sys/statvfs.h | 41 |
3 files changed, 53 insertions, 1 deletions
diff --git a/winsup/cygwin/include/cygwin/types.h b/winsup/cygwin/include/cygwin/types.h index 3964ae3a9..9b5c51b73 100644 --- a/winsup/cygwin/include/cygwin/types.h +++ b/winsup/cygwin/include/cygwin/types.h @@ -66,6 +66,16 @@ typedef __blkcnt32_t blkcnt_t; #endif #endif /*__blkcnt_t_defined*/ +#ifndef __fsblkcnt_t_defined +#define __fsblkcnt_t_defined +typedef unsigned long fsblkcnt_t; +#endif /* __fsblkcnt_t_defined */ + +#ifndef __fsfilcnt_t_defined +#define __fsfilcnt_t_defined +typedef unsigned long fsfilcnt_t; +#endif /* __fsfilcnt_t_defined */ + #ifndef __uid_t_defined #define __uid_t_defined typedef unsigned short __uid16_t; diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index fac4ea2ea..10cf2ba2d 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -248,12 +248,13 @@ details. */ 118: Export getpriority, setpriority. 119: Export fdatasync. 120: Export basename, dirname. + 121: Export statvfs, fstatvfs. */ /* Note that we forgot to bump the api for ualarm, strtoll, strtoull */ #define CYGWIN_VERSION_API_MAJOR 0 -#define CYGWIN_VERSION_API_MINOR 120 +#define CYGWIN_VERSION_API_MINOR 121 /* There is also a compatibity version number associated with the shared memory regions. It is incremented when incompatible diff --git a/winsup/cygwin/include/sys/statvfs.h b/winsup/cygwin/include/sys/statvfs.h new file mode 100644 index 000000000..a32c19866 --- /dev/null +++ b/winsup/cygwin/include/sys/statvfs.h @@ -0,0 +1,41 @@ +/* sys/statvfs.h + + Copyright 2005 Red Hat, Inc. + +This file is part of Cygwin. + +This software is a copyrighted work licensed under the terms of the +Cygwin license. Please consult the file "CYGWIN_LICENSE" for +details. */ + +#ifndef _SYS_STATVFS_H_ +#define _SYS_STATVFS_H_ + +#include <sys/types.h> + +struct statvfs { + unsigned long f_bsize; /* file system block size */ + unsigned long f_frsize; /* fragment size */ + fsblkcnt_t f_blocks; /* size of fs in f_frsize units */ + fsblkcnt_t f_bfree; /* free blocks in fs */ + fsblkcnt_t f_bavail; /* free blocks avail to non-superuser */ + fsfilcnt_t f_files; /* total file nodes in file system */ + fsfilcnt_t f_ffree; /* free file nodes in fs */ + fsfilcnt_t f_favail; /* avail file nodes in fs */ + unsigned long f_fsid; /* file system id */ + unsigned long f_flag; /* mount flags */ + unsigned long f_namemax; /* maximum length of filenames */ +}; + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +int statvfs (const char *__path, struct statvfs *__buf); +int fstatvfs (int __fd, struct statvfs *__buf); + +#ifdef __cplusplus +}; +#endif /* __cplusplus */ + +#endif /*_SYS_STATVFS_H_*/ |