Changeset 11627 for trunk/libtransmission/platform.c
- Timestamp:
- Jan 5, 2011, 4:41:19 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/platform.c
r11599 r11627 35 35 #include <string.h> 36 36 37 #ifdef SYS_DARWIN 38 #define HAVE_SYS_STATVFS_H 39 #define HAVE_STATVFS 40 #endif 41 37 42 #include <sys/stat.h> 38 43 #include <sys/types.h> 44 #ifdef HAVE_SYS_STATVFS_H 45 #include <sys/statvfs.h> 46 #endif 39 47 #ifdef WIN32 40 48 #include <libgen.h> … … 679 687 ***/ 680 688 689 int64_t 690 tr_getFreeSpace( const char * path ) 691 { 692 #ifdef WIN32 693 uint64_t freeBytesAvailable = 0; 694 return GetDiskFreeSpaceEx( path, &freeBytesAvailable, NULL, NULL) 695 ? (int64_t)freeBytesAvailable 696 : -1; 697 #elif defined(HAVE_STATVFS) 698 struct statvfs buf; 699 return statvfs( path, &buf ) ? -1 : (int64_t)buf.f_bavail * (int64_t)buf.f_bsize; 700 #else 701 #warning FIXME: not implemented 702 return -1; 703 #endif 704 } 705 706 /*** 707 **** 708 ***/ 709 681 710 #ifdef WIN32 682 711 … … 798 827 799 828 #endif 800
Note: See TracChangeset
for help on using the changeset viewer.