Commit | Line | Data |
---|---|---|
2c0ecd28 JA |
1 | #ifndef FIO_OS_SOLARIS_H |
2 | #define FIO_OS_SOLARIS_H | |
3 | ||
e116f2b9 JA |
4 | #include <sys/types.h> |
5 | #include <sys/fcntl.h> | |
6 | ||
2c0ecd28 | 7 | #define FIO_HAVE_POSIXAIO |
417f0068 | 8 | #define FIO_HAVE_SOLARISAIO |
fffca02d | 9 | #define FIO_HAVE_FALLOCATE |
207cb0f0 | 10 | #define FIO_HAVE_POSIXAIO_FSYNC |
2c0ecd28 | 11 | |
dc873b6f JA |
12 | #define OS_MAP_ANON MAP_ANON |
13 | #define OS_RAND_MAX 2147483648UL | |
2c0ecd28 | 14 | |
f022ddb7 JA |
15 | struct solaris_rand_seed { |
16 | unsigned short r[3]; | |
17 | }; | |
18 | ||
2c0ecd28 | 19 | typedef unsigned long os_cpu_mask_t; |
f022ddb7 | 20 | typedef struct solaris_rand_seed os_random_state_t; |
2c0ecd28 JA |
21 | |
22 | /* | |
23 | * FIXME | |
24 | */ | |
25 | static inline int blockdev_size(int fd, unsigned long long *bytes) | |
26 | { | |
e5b401d4 JA |
27 | return EINVAL; |
28 | } | |
29 | ||
30 | static inline int blockdev_invalidate_cache(int fd) | |
31 | { | |
32 | return EINVAL; | |
2c0ecd28 JA |
33 | } |
34 | ||
35 | static inline unsigned long long os_phys_mem(void) | |
36 | { | |
2c0ecd28 | 37 | return 0; |
2c0ecd28 JA |
38 | } |
39 | ||
40 | static inline void os_random_seed(unsigned long seed, os_random_state_t *rs) | |
41 | { | |
f022ddb7 JA |
42 | rs->r[0] = seed & 0xffff; |
43 | seed >>= 16; | |
44 | rs->r[1] = seed & 0xffff; | |
45 | seed >>= 16; | |
46 | rs->r[2] = seed & 0xffff; | |
47 | seed48(rs->r); | |
2c0ecd28 JA |
48 | } |
49 | ||
50 | static inline long os_random_long(os_random_state_t *rs) | |
51 | { | |
f022ddb7 | 52 | return nrand48(rs->r); |
2c0ecd28 JA |
53 | } |
54 | ||
e116f2b9 JA |
55 | #define FIO_OS_DIRECTIO |
56 | extern int directio(int, int); | |
57 | static inline int fio_set_odirect(int fd) | |
58 | { | |
59 | if (directio(fd, DIRECTIO_ON) < 0) | |
60 | return errno; | |
61 | ||
62 | return 0; | |
63 | } | |
64 | ||
2c0ecd28 | 65 | #endif |