projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
FreeBSD: use generic bdev size retrieval
[fio.git]
/
os
/
os-freebsd.h
diff --git
a/os/os-freebsd.h
b/os/os-freebsd.h
index 3939d65254ab81edf7e4a06abdcf4399bdccdbf9..e517ec0f261f5ae618ac1395a52d581c3a15b541 100644
(file)
--- a/
os/os-freebsd.h
+++ b/
os/os-freebsd.h
@@
-17,7
+17,13
@@
typedef unsigned int os_random_state_t;
*/
static inline int blockdev_size(int fd, unsigned long long *bytes)
{
- return EINVAL;
+ off_t end = lseek(fd, 0, SEEK_END);
+
+ if (end < 0)
+ return errno;
+
+ *bytes = end;
+ return 0;
}
static inline int blockdev_invalidate_cache(int fd)