projects
/
oweals
/
gnunet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ac01064
)
-LRN: w32 version of fstat
author
Christian Grothoff
<christian@grothoff.org>
Thu, 15 Dec 2011 18:44:52 +0000
(18:44 +0000)
committer
Christian Grothoff
<christian@grothoff.org>
Thu, 15 Dec 2011 18:44:52 +0000
(18:44 +0000)
src/util/disk.c
patch
|
blob
|
history
diff --git
a/src/util/disk.c
b/src/util/disk.c
index ba5d159e410391e5c57ed428814c5f9ea8f66641..0c9093fbc6077ed72fdf4fe1ff7952becd12ada1 100644
(file)
--- a/
src/util/disk.c
+++ b/
src/util/disk.c
@@
-216,11
+216,23
@@
int
GNUNET_DISK_file_handle_size (struct GNUNET_DISK_FileHandle *fh,
off_t *size)
{
+#if WINDOWS
+ BOOL b;
+ LARGE_INTEGER li;
+ b = GetFileSizeEx (fh->h, &li);
+ if (!b)
+ {
+ SetErrnoFromWinError (GetLastError ());
+ return GNUNET_SYSERR;
+ }
+ *size = (off_t) li.QuadPart;
+#else
struct stat sbuf;
if (0 != FSTAT (fh->fd, &sbuf))
return GNUNET_SYSERR;
*size = sbuf.st_size;
+#endif
return GNUNET_OK;
}