Compile warning for non-signal driven solaris asynch io
[fio.git] / os / os-solaris.h
1 #ifndef FIO_OS_SOLARIS_H
2 #define FIO_OS_SOLARIS_H
3
4 #include <sys/types.h>
5 #include <sys/fcntl.h>
6
7 #define FIO_HAVE_POSIXAIO
8 #define FIO_HAVE_SOLARISAIO
9 #define FIO_HAVE_FALLOCATE
10 #define FIO_HAVE_POSIXAIO_FSYNC
11
12 #define OS_MAP_ANON             (MAP_ANON)
13
14 struct solaris_rand_seed {
15         unsigned short r[3];
16 };
17
18 typedef unsigned long os_cpu_mask_t;
19 typedef struct solaris_rand_seed os_random_state_t;
20
21 /*
22  * FIXME
23  */
24 static inline int blockdev_size(int fd, unsigned long long *bytes)
25 {
26         return EINVAL;
27 }
28
29 static inline int blockdev_invalidate_cache(int fd)
30 {
31         return EINVAL;
32 }
33
34 static inline unsigned long long os_phys_mem(void)
35 {
36         return 0;
37 }
38
39 static inline void os_random_seed(unsigned long seed, os_random_state_t *rs)
40 {
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);
47 }
48
49 static inline long os_random_long(os_random_state_t *rs)
50 {
51         return nrand48(rs->r);
52 }
53
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
64 #endif