Add Solaris native aio engine
[fio.git] / os / os-solaris.h
CommitLineData
2c0ecd28
JA
1#ifndef FIO_OS_SOLARIS_H
2#define FIO_OS_SOLARIS_H
3
4#undef FIO_HAVE_LIBAIO
5#define FIO_HAVE_POSIXAIO
417f0068 6#define FIO_HAVE_SOLARISAIO
2c0ecd28
JA
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
13#define OS_MAP_ANON (MAP_ANON)
14
15typedef unsigned long os_cpu_mask_t;
16typedef unsigned int os_random_state_t;
17
18/*
19 * FIXME
20 */
21static inline int blockdev_size(int fd, unsigned long long *bytes)
22{
e5b401d4
JA
23 return EINVAL;
24}
25
26static inline int blockdev_invalidate_cache(int fd)
27{
28 return EINVAL;
2c0ecd28
JA
29}
30
31static inline unsigned long long os_phys_mem(void)
32{
33#if 0
34 int mib[2] = { CTL_HW, HW_PHYSMEM };
35 unsigned long long mem;
36 size_t len = sizeof(mem);
37
38 sysctl(mib, 2, &mem, &len, NULL, 0);
39 return mem;
40#else
41 return 0;
42#endif
43}
44
45static inline void os_random_seed(unsigned long seed, os_random_state_t *rs)
46{
47 srand(seed);
48}
49
50static inline long os_random_long(os_random_state_t *rs)
51{
52 long val;
53
54 val = rand_r(rs);
55 return val;
56}
57
2c0ecd28 58#endif