Mercurial > hg > svcore
comparison system/System.cpp @ 436:cff476cfce77 sv1-v1.3 sv1-v1.3rc1
* Updates for 1.3
author | Chris Cannam |
---|---|
date | Thu, 10 Jul 2008 12:50:56 +0000 |
parents | 65311fb86166 |
children | ca208281238b |
comparison
equal
deleted
inserted
replaced
435:824a87450f81 | 436:cff476cfce77 |
---|---|
256 #else | 256 #else |
257 struct statvfs buf; | 257 struct statvfs buf; |
258 if (!statvfs(path, &buf)) { | 258 if (!statvfs(path, &buf)) { |
259 // do the multiplies and divides in this order to reduce the | 259 // do the multiplies and divides in this order to reduce the |
260 // likelihood of arithmetic overflow | 260 // likelihood of arithmetic overflow |
261 std::cerr << "statvfs(" << path << ") says available: " << buf.f_bavail << ", block size: " << buf.f_bsize << std::endl; | 261 // std::cerr << "statvfs(" << path << ") says available: " << buf.f_bavail << ", block size: " << buf.f_bsize << std::endl; |
262 uint64_t available = ((buf.f_bavail / 1024) * buf.f_bsize) / 1024; | 262 uint64_t available = ((buf.f_bavail / 1024) * buf.f_bsize) / 1024; |
263 if (available > INT_MAX) available = INT_MAX; | 263 if (available > INT_MAX) available = INT_MAX; |
264 return int(available); | 264 return int(available); |
265 } else { | 265 } else { |
266 perror("statvfs failed"); | 266 perror("statvfs failed"); |