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 JA |
11 | |
12 | #define OS_MAP_ANON (MAP_ANON) | |
13 | ||
f022ddb7 JA |
14 | struct solaris_rand_seed { |
15 | unsigned short r[3]; | |
16 | }; | |
17 | ||
2c0ecd28 | 18 | typedef unsigned long os_cpu_mask_t; |
f022ddb7 | 19 | typedef struct solaris_rand_seed os_random_state_t; |
2c0ecd28 JA |
20 | |
21 | /* | |
22 | * FIXME | |
23 | */ | |
24 | static inline int blockdev_size(int fd, unsigned long long *bytes) | |
25 | { | |
e5b401d4 JA |
26 | return EINVAL; |
27 | } | |
28 | ||
29 | static inline int blockdev_invalidate_cache(int fd) | |
30 | { | |
31 | return EINVAL; | |
2c0ecd28 JA |
32 | } |
33 | ||
34 | static inline unsigned long long os_phys_mem(void) | |
35 | { | |
2c0ecd28 | 36 | return 0; |
2c0ecd28 JA |
37 | } |
38 | ||
39 | static inline void os_random_seed(unsigned long seed, os_random_state_t *rs) | |
40 | { | |
f022ddb7 JA |
41 | rs->r[0] = seed & 0xffff; |
42 | seed >>= 16; | |
43 | rs->r[1] = seed & 0xffff; | |
44 | seed >>= 16; | |
45 | rs->r[2] = seed & 0xffff; | |
46 | seed48(rs->r); | |
2c0ecd28 JA |
47 | } |
48 | ||
49 | static inline long os_random_long(os_random_state_t *rs) | |
50 | { | |
f022ddb7 | 51 | return nrand48(rs->r); |
2c0ecd28 JA |
52 | } |
53 | ||
e116f2b9 JA |
54 | #define FIO_OS_DIRECTIO |
55 | extern int directio(int, int); | |
56 | static inline int fio_set_odirect(int fd) | |
57 | { | |
58 | if (directio(fd, DIRECTIO_ON) < 0) | |
59 | return errno; | |
60 | ||
61 | return 0; | |
62 | } | |
63 | ||
2c0ecd28 | 64 | #endif |