1 #ifndef FIO_OS_SOLARIS_H
2 #define FIO_OS_SOLARIS_H
8 #define FIO_HAVE_POSIXAIO
9 #define FIO_HAVE_SOLARISAIO
10 #define FIO_HAVE_FALLOCATE
11 #define FIO_HAVE_POSIXAIO_FSYNC
12 #define FIO_HAVE_CPU_AFFINITY
14 #define OS_MAP_ANON MAP_ANON
15 #define OS_RAND_MAX 2147483648UL
17 struct solaris_rand_seed {
21 typedef psetid_t os_cpu_mask_t;
22 typedef struct solaris_rand_seed os_random_state_t;
27 static inline int blockdev_size(int fd, unsigned long long *bytes)
32 static inline int blockdev_invalidate_cache(int fd)
37 static inline unsigned long long os_phys_mem(void)
42 static inline void os_random_seed(unsigned long seed, os_random_state_t *rs)
44 rs->r[0] = seed & 0xffff;
46 rs->r[1] = seed & 0xffff;
48 rs->r[2] = seed & 0xffff;
52 static inline long os_random_long(os_random_state_t *rs)
54 return nrand48(rs->r);
57 #define FIO_OS_DIRECTIO
58 extern int directio(int, int);
59 static inline int fio_set_odirect(int fd)
61 if (directio(fd, DIRECTIO_ON) < 0)
68 * pset binding hooks for fio
70 #define fio_setaffinity(td) \
71 pset_bind((td)->o.cpumask, P_PID, (td)->pid, NULL)
72 #define fio_getaffinity(pid, ptr) ({ 0; })
74 #define fio_cpu_clear(mask, cpu) pset_assign(PS_NONE, (cpu), NULL)
75 #define fio_cpu_set(mask, cpu) pset_assign(*(mask), (cpu), NULL)
77 static inline int fio_cpuset_init(os_cpu_mask_t *mask)
81 if (pset_create(mask) < 0) {
89 static inline int fio_cpuset_exit(os_cpu_mask_t *mask)
93 if (pset_destroy(*mask) < 0) {
102 * Should be enough, not aware of what (if any) restrictions Solaris has
104 #define FIO_MAX_CPUS 16384