Commit | Line | Data |
---|---|---|
2c0ecd28 JA |
1 | #ifndef FIO_OS_SOLARIS_H |
2 | #define FIO_OS_SOLARIS_H | |
3 | ||
2c0ecd28 | 4 | #define FIO_HAVE_POSIXAIO |
417f0068 | 5 | #define FIO_HAVE_SOLARISAIO |
fffca02d | 6 | #define FIO_HAVE_FALLOCATE |
207cb0f0 | 7 | #define FIO_HAVE_POSIXAIO_FSYNC |
2c0ecd28 JA |
8 | |
9 | #define OS_MAP_ANON (MAP_ANON) | |
10 | ||
11 | typedef unsigned long os_cpu_mask_t; | |
12 | typedef unsigned int os_random_state_t; | |
13 | ||
14 | /* | |
15 | * FIXME | |
16 | */ | |
17 | static inline int blockdev_size(int fd, unsigned long long *bytes) | |
18 | { | |
e5b401d4 JA |
19 | return EINVAL; |
20 | } | |
21 | ||
22 | static inline int blockdev_invalidate_cache(int fd) | |
23 | { | |
24 | return EINVAL; | |
2c0ecd28 JA |
25 | } |
26 | ||
27 | static inline unsigned long long os_phys_mem(void) | |
28 | { | |
29 | #if 0 | |
30 | int mib[2] = { CTL_HW, HW_PHYSMEM }; | |
31 | unsigned long long mem; | |
32 | size_t len = sizeof(mem); | |
33 | ||
34 | sysctl(mib, 2, &mem, &len, NULL, 0); | |
35 | return mem; | |
36 | #else | |
37 | return 0; | |
38 | #endif | |
39 | } | |
40 | ||
41 | static inline void os_random_seed(unsigned long seed, os_random_state_t *rs) | |
42 | { | |
43 | srand(seed); | |
44 | } | |
45 | ||
46 | static inline long os_random_long(os_random_state_t *rs) | |
47 | { | |
48 | long val; | |
49 | ||
50 | val = rand_r(rs); | |
51 | return val; | |
52 | } | |
53 | ||
2c0ecd28 | 54 | #endif |