aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/disk.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/util/disk.c b/src/util/disk.c
index 2474f0f2a..ef4e33cd2 100644
--- a/src/util/disk.c
+++ b/src/util/disk.c
@@ -248,7 +248,7 @@ GNUNET_DISK_file_size (const char *filename,
248 */ 248 */
249int 249int
250GNUNET_DISK_file_get_identifiers (const char *filename, 250GNUNET_DISK_file_get_identifiers (const char *filename,
251 uint32_t * dev, uint64_t * ino) 251 uint64_t * dev, uint64_t * ino)
252{ 252{
253#if LINUX 253#if LINUX
254 struct stat sbuf; 254 struct stat sbuf;
@@ -256,10 +256,21 @@ GNUNET_DISK_file_get_identifiers (const char *filename,
256 256
257 if ((0 == stat (filename, &sbuf)) && (0 == statvfs (filename, &fbuf))) 257 if ((0 == stat (filename, &sbuf)) && (0 == statvfs (filename, &fbuf)))
258 { 258 {
259 *dev = (uint32_t) fbuf.f_fsid; 259 *dev = (uint64_t) fbuf.f_fsid;
260 *ino = (uint64_t) sbuf.st_ino; 260 *ino = (uint64_t) sbuf.st_ino;
261 return GNUNET_OK; 261 return GNUNET_OK;
262 } 262 }
263#elif SOMEBSD
264 struct stat sbuf;
265 struct statfs fbuf;
266
267 if ( (0 == stat (filename, &sbuf)) &&
268 (0 == statfs (filename, &fbuf) ) )
269 {
270 *dev = ((uint64_t) fbuf.f_fsid[0]) << 32 || ((uint64_t) fbuf.f_fsid[1]);
271 *ino = (uint64_t) sbuf.st_ino;
272 return GNUNET_OK;
273 }
263#elif WINDOWS 274#elif WINDOWS
264 // FIXME NILS: test this 275 // FIXME NILS: test this
265 struct GNUNET_DISK_FileHandle *fh; 276 struct GNUNET_DISK_FileHandle *fh;