posixaio: not all platforms have aio_fsync()
[fio.git] / os / os-solaris.h
1 #ifndef FIO_OS_SOLARIS_H
2 #define FIO_OS_SOLARIS_H
3
4 #undef FIO_HAVE_LIBAIO
5 #define FIO_HAVE_POSIXAIO
6 #define FIO_HAVE_SOLARISAIO
7 #undef FIO_HAVE_FADVISE
8 #undef FIO_HAVE_CPU_AFFINITY
9 #undef FIO_HAVE_DISK_UTIL
10 #undef FIO_HAVE_SGIO
11 #undef FIO_HAVE_ODIRECT
12 #define FIO_HAVE_FALLOCATE
13 #define FIO_HAVE_POSIXAIO_FSYNC
14
15 #define OS_MAP_ANON             (MAP_ANON)
16
17 typedef unsigned long os_cpu_mask_t;
18 typedef unsigned int os_random_state_t;
19
20 /*
21  * FIXME
22  */
23 static inline int blockdev_size(int fd, unsigned long long *bytes)
24 {
25         return EINVAL;
26 }
27
28 static inline int blockdev_invalidate_cache(int fd)
29 {
30         return EINVAL;
31 }
32
33 static inline unsigned long long os_phys_mem(void)
34 {
35 #if 0
36         int mib[2] = { CTL_HW, HW_PHYSMEM };
37         unsigned long long mem;
38         size_t len = sizeof(mem);
39
40         sysctl(mib, 2, &mem, &len, NULL, 0);
41         return mem;
42 #else
43         return 0;
44 #endif
45 }
46
47 static inline void os_random_seed(unsigned long seed, os_random_state_t *rs)
48 {
49         srand(seed);
50 }
51
52 static inline long os_random_long(os_random_state_t *rs)
53 {
54         long val;
55
56         val = rand_r(rs);
57         return val;
58 }
59
60 #endif