1993-08-05 18:28:27 +00:00
|
|
|
/* bytfre.c
|
|
|
|
Get the number of bytes free on a file system. */
|
|
|
|
|
|
|
|
#include "uucp.h"
|
|
|
|
|
|
|
|
#include "system.h"
|
|
|
|
#include "sysdep.h"
|
|
|
|
#include "fsusg.h"
|
|
|
|
|
1995-08-19 21:30:30 +00:00
|
|
|
#if HAVE_LIMITS_H
|
|
|
|
#include <limits.h>
|
|
|
|
#else
|
|
|
|
#define LONG_MAX 2147483647
|
|
|
|
#endif
|
|
|
|
|
1993-08-05 18:28:27 +00:00
|
|
|
long
|
|
|
|
csysdep_bytes_free (zfile)
|
|
|
|
const char *zfile;
|
|
|
|
{
|
|
|
|
struct fs_usage s;
|
|
|
|
|
|
|
|
if (get_fs_usage ((char *) zfile, (char *) NULL, &s) < 0)
|
|
|
|
return -1;
|
1995-08-19 21:30:30 +00:00
|
|
|
if (s.fsu_bavail >= LONG_MAX / (long) 512)
|
|
|
|
return LONG_MAX;
|
1993-08-05 18:28:27 +00:00
|
|
|
return s.fsu_bavail * (long) 512;
|
|
|
|
}
|