1 #ifndef FIO_OS_SOLARIS_H
2 #define FIO_OS_SOLARIS_H
9 #define FIO_HAVE_POSIXAIO
10 #define FIO_HAVE_SOLARISAIO
11 #define FIO_HAVE_FALLOCATE
12 #define FIO_HAVE_POSIXAIO_FSYNC
13 #define FIO_HAVE_CPU_AFFINITY
14 #define FIO_HAVE_PSHARED_MUTEX
15 #define FIO_USE_GENERIC_BDEV_SIZE
17 #define OS_MAP_ANON MAP_ANON
18 #define OS_RAND_MAX 2147483648UL
20 struct solaris_rand_seed {
24 typedef psetid_t os_cpu_mask_t;
25 typedef struct solaris_rand_seed os_random_state_t;
27 static inline int blockdev_invalidate_cache(int fd)
32 static inline unsigned long long os_phys_mem(void)
37 static inline void os_random_seed(unsigned long seed, os_random_state_t *rs)
39 rs->r[0] = seed & 0xffff;
41 rs->r[1] = seed & 0xffff;
43 rs->r[2] = seed & 0xffff;
47 static inline long os_random_long(os_random_state_t *rs)
49 return nrand48(rs->r);
52 #define FIO_OS_DIRECTIO
53 extern int directio(int, int);
54 static inline int fio_set_odirect(int fd)
56 if (directio(fd, DIRECTIO_ON) < 0)
63 * pset binding hooks for fio
65 #define fio_setaffinity(pid, cpumask) \
66 pset_bind((cpumask), P_PID, (pid), NULL)
67 #define fio_getaffinity(pid, ptr) ({ 0; })
69 #define fio_cpu_clear(mask, cpu) pset_assign(PS_NONE, (cpu), NULL)
70 #define fio_cpu_set(mask, cpu) pset_assign(*(mask), (cpu), NULL)
72 static inline int fio_cpuset_init(os_cpu_mask_t *mask)
76 if (pset_create(mask) < 0) {
84 static inline int fio_cpuset_exit(os_cpu_mask_t *mask)
88 if (pset_destroy(*mask) < 0) {
97 * Should be enough, not aware of what (if any) restrictions Solaris has
99 #define FIO_MAX_CPUS 16384
102 #define FIO_MADV_FREE MADV_FREE