1 #ifndef FIO_OS_SOLARIS_H
2 #define FIO_OS_SOLARIS_H
12 #define FIO_HAVE_POSIXAIO
13 #define FIO_HAVE_SOLARISAIO
14 #define FIO_HAVE_FALLOCATE
15 #define FIO_HAVE_POSIXAIO_FSYNC
16 #define FIO_HAVE_CPU_AFFINITY
17 #define FIO_HAVE_PSHARED_MUTEX
18 #define FIO_USE_GENERIC_BDEV_SIZE
19 #define FIO_HAVE_FDATASYNC
21 #define OS_MAP_ANON MAP_ANON
22 #define OS_RAND_MAX 2147483648UL
24 struct solaris_rand_seed {
28 typedef psetid_t os_cpu_mask_t;
29 typedef struct solaris_rand_seed os_random_state_t;
31 static inline int blockdev_invalidate_cache(struct fio_file *f)
36 static inline unsigned long long os_phys_mem(void)
41 static inline void os_random_seed(unsigned long seed, os_random_state_t *rs)
43 rs->r[0] = seed & 0xffff;
45 rs->r[1] = seed & 0xffff;
47 rs->r[2] = seed & 0xffff;
51 static inline long os_random_long(os_random_state_t *rs)
53 return nrand48(rs->r);
56 #define FIO_OS_DIRECTIO
57 extern int directio(int, int);
58 static inline int fio_set_odirect(int fd)
60 if (directio(fd, DIRECTIO_ON) < 0)
67 * pset binding hooks for fio
69 #define fio_setaffinity(pid, cpumask) \
70 pset_bind((cpumask), P_PID, (pid), NULL)
71 #define fio_getaffinity(pid, ptr) ({ 0; })
73 #define fio_cpu_clear(mask, cpu) pset_assign(PS_NONE, (cpu), NULL)
74 #define fio_cpu_set(mask, cpu) pset_assign(*(mask), (cpu), NULL)
76 static inline int fio_cpuset_init(os_cpu_mask_t *mask)
80 if (pset_create(mask) < 0) {
88 static inline int fio_cpuset_exit(os_cpu_mask_t *mask)
92 if (pset_destroy(*mask) < 0) {
101 * Should be enough, not aware of what (if any) restrictions Solaris has
103 #define FIO_MAX_CPUS 16384
106 #define FIO_MADV_FREE MADV_FREE