blob: 038634d1ce7fad0883d20a197811ab55be2bcebd [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
Jens Axboe417f0062008-06-02 11:59:30 +02006#define FIO_HAVE_SOLARISAIO
Jens Axboe2c0ecd22006-06-08 13:25:41 +02007#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
Jens Axboefffca022008-06-02 12:23:40 +020012#define FIO_HAVE_FALLOCATE
Jens Axboe207cb0f2008-06-02 12:28:02 +020013#define FIO_HAVE_POSIXAIO_FSYNC
Jens Axboe2c0ecd22006-06-08 13:25:41 +020014
15#define OS_MAP_ANON (MAP_ANON)
16
17typedef unsigned long os_cpu_mask_t;
18typedef unsigned int os_random_state_t;
19
20/*
21 * FIXME
22 */
23static inline int blockdev_size(int fd, unsigned long long *bytes)
24{
Jens Axboee5b401d2006-10-18 16:03:40 +020025 return EINVAL;
26}
27
28static inline int blockdev_invalidate_cache(int fd)
29{
30 return EINVAL;
Jens Axboe2c0ecd22006-06-08 13:25:41 +020031}
32
33static 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
47static inline void os_random_seed(unsigned long seed, os_random_state_t *rs)
48{
49 srand(seed);
50}
51
52static 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
Jens Axboe2c0ecd22006-06-08 13:25:41 +020060#endif