version 1.11, 2009/10/27 23:59:42 |
version 1.12, 2011/04/10 15:47:28 |
|
|
* information. |
* information. |
*/ |
*/ |
int |
int |
getfilesysinfo(char *file, long *freespace, long *freefiles) |
getfilesysinfo(char *file, int64_t *freespace, int64_t *freefiles) |
{ |
{ |
#if defined(STATFS_TYPE) |
#if defined(STATFS_TYPE) |
static statfs_t statfsbuf; |
static statfs_t statfsbuf; |
|
|
* to < 0 if the field is unsupported for the filesystem type. |
* to < 0 if the field is unsupported for the filesystem type. |
*/ |
*/ |
#if defined(BROKEN_STATFS) |
#if defined(BROKEN_STATFS) |
if (statfsbuf.f_ffree > 0) |
if (statfsbuf.f_favail > 0) |
#else |
#else |
if (statfsbuf.f_ffree >= 0) |
if (statfsbuf.f_favail >= 0) |
#endif /* BROKEN_STATFS */ |
#endif /* BROKEN_STATFS */ |
*freefiles = statfsbuf.f_ffree; |
*freefiles = statfsbuf.f_favail; |
|
|
#else /* !STATFS_TYPE */ |
#else /* !STATFS_TYPE */ |
|
|