1 #ifndef FIO_OS_SOLARIS_H
2 #define FIO_OS_SOLARIS_H
10 #define FIO_HAVE_POSIXAIO
11 #define FIO_HAVE_SOLARISAIO
12 #define FIO_HAVE_FALLOCATE
13 #define FIO_HAVE_POSIXAIO_FSYNC
14 #define FIO_HAVE_CPU_AFFINITY
15 #define FIO_HAVE_PSHARED_MUTEX
16 #define FIO_USE_GENERIC_BDEV_SIZE
17 #define FIO_HAVE_FDATASYNC
18 #define FIO_HAVE_CLOCK_MONOTONIC
20 #define OS_MAP_ANON MAP_ANON
21 #define OS_RAND_MAX 2147483648UL
23 struct solaris_rand_seed {
27 typedef psetid_t os_cpu_mask_t;
28 typedef struct solaris_rand_seed os_random_state_t;
30 static inline int blockdev_invalidate_cache(struct fio_file fio_unused *f)
35 static inline unsigned long long os_phys_mem(void)
40 static inline void os_random_seed(unsigned long seed, os_random_state_t *rs)
42 rs->r[0] = seed & 0xffff;
44 rs->r[1] = seed & 0xffff;
46 rs->r[2] = seed & 0xffff;
50 static inline long os_random_long(os_random_state_t *rs)
52 return nrand48(rs->r);
55 #define FIO_OS_DIRECTIO
56 extern int directio(int, int);
57 static inline int fio_set_odirect(int fd)
59 if (directio(fd, DIRECTIO_ON) < 0)
66 * pset binding hooks for fio
68 #define fio_setaffinity(pid, cpumask) \
69 pset_bind((cpumask), P_PID, (pid), NULL)
70 #define fio_getaffinity(pid, ptr) ({ 0; })
72 #define fio_cpu_clear(mask, cpu) pset_assign(PS_NONE, (cpu), NULL)
73 #define fio_cpu_set(mask, cpu) pset_assign(*(mask), (cpu), NULL)
75 static inline int fio_cpuset_init(os_cpu_mask_t *mask)
79 if (pset_create(mask) < 0) {
87 static inline int fio_cpuset_exit(os_cpu_mask_t *mask)
91 if (pset_destroy(*mask) < 0) {
100 * Should be enough, not aware of what (if any) restrictions Solaris has
102 #define FIO_MAX_CPUS 16384
105 #define FIO_MADV_FREE MADV_FREE