projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
solaris: add os_phys_mem() implementation
[fio.git]
/
os
/
os-solaris.h
diff --git
a/os/os-solaris.h
b/os/os-solaris.h
index a6cd3766a5761a632a03ba7216c3a0a28e4556ee..644807c5084fdf9d5f1c35a30a0daa97af24bc45 100644
(file)
--- a/
os/os-solaris.h
+++ b/
os/os-solaris.h
@@
-66,7
+66,14
@@
static inline int blockdev_invalidate_cache(struct fio_file *f)
static inline unsigned long long os_phys_mem(void)
{
static inline unsigned long long os_phys_mem(void)
{
- return 0;
+ long pagesize, pages;
+
+ pagesize = sysconf(_SC_PAGESIZE);
+ pages = sysconf(_SC_PHYS_PAGES);
+ if (pages == -1 || pagesize == -1)
+ return 0;
+
+ return (unsigned long long) pages * (unsigned long long) pagesize;
}
static inline void os_random_seed(unsigned long seed, os_random_state_t *rs)
}
static inline void os_random_seed(unsigned long seed, os_random_state_t *rs)