15 #ifdef HAVE_SYS_STATVFS_H
16 #include <sys/statvfs.h>
33 memset(&st, 0,
sizeof(st));
35 r = statvfs(path, &st);
39 int64_t result = st.f_bavail;
41 result *= st.f_frsize;
42 }
else if (st.f_bsize) {
50 ULARGE_INTEGER freeBytesAvail;
53 ok = GetDiskFreeSpaceEx(path, &freeBytesAvail, NULL, NULL);
57 return (int64_t)freeBytesAvail.QuadPart;
Wrappers for reading and writing data to files on disk.
int64_t tor_get_avail_disk_space(const char *path)
Integer definitions used throughout Tor.