blob: 898da18e988d205004f8826c8ba08d6768ac2352 [file] [log] [blame]
Jens Axboe2c0ecd22006-06-08 13:25:41 +02001#ifndef FIO_OS_SOLARIS_H
2#define FIO_OS_SOLARIS_H
3
4#undef FIO_HAVE_LIBAIO
5#define FIO_HAVE_POSIXAIO
6#undef FIO_HAVE_FADVISE
7#undef FIO_HAVE_CPU_AFFINITY
8#undef FIO_HAVE_DISK_UTIL
9#undef FIO_HAVE_SGIO
10#undef FIO_HAVE_ODIRECT
11
12#define OS_MAP_ANON (MAP_ANON)
13
14typedef unsigned long os_cpu_mask_t;
15typedef unsigned int os_random_state_t;
16
17/*
18 * FIXME
19 */
20static inline int blockdev_size(int fd, unsigned long long *bytes)
21{
Jens Axboee5b401d2006-10-18 16:03:40 +020022 return EINVAL;
23}
24
25static inline int blockdev_invalidate_cache(int fd)
26{
27 return EINVAL;
Jens Axboe2c0ecd22006-06-08 13:25:41 +020028}
29
30static inline unsigned long long os_phys_mem(void)
31{
32#if 0
33 int mib[2] = { CTL_HW, HW_PHYSMEM };
34 unsigned long long mem;
35 size_t len = sizeof(mem);
36
37 sysctl(mib, 2, &mem, &len, NULL, 0);
38 return mem;
39#else
40 return 0;
41#endif
42}
43
44static inline void os_random_seed(unsigned long seed, os_random_state_t *rs)
45{
46 srand(seed);
47}
48
49static inline long os_random_long(os_random_state_t *rs)
50{
51 long val;
52
53 val = rand_r(rs);
54 return val;
55}
56
57static inline double os_random_double(os_random_state_t *rs)
58{
59 double val;
60
61 val = (double) rand_r(rs);
62 return val;
63}
64
65#endif