projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
983b770
)
solaris: implement blockdev size getting
author
Jens Axboe
<jens.axboe@oracle.com>
Tue, 4 Aug 2009 10:49:59 +0000
(12:49 +0200)
committer
Jens Axboe
<jens.axboe@oracle.com>
Tue, 4 Aug 2009 10:49:59 +0000
(12:49 +0200)
Just use lseek(..., SEEK_END), we should actually be able to use that
on all platforms.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
os/os-solaris.h
patch
|
blob
|
blame
|
history
diff --git
a/os/os-solaris.h
b/os/os-solaris.h
index f00aae1089b19380fd05d2f8017facea2847cea5..c49ce8d99abdd21f611c11ec5c90952314cd1c05 100644
(file)
--- a/
os/os-solaris.h
+++ b/
os/os-solaris.h
@@
-28,7
+28,13
@@
typedef struct solaris_rand_seed 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)