Jens Axboe | 2c0ecd2 | 2006-06-08 13:25:41 +0200 | [diff] [blame] | 1 | #ifndef FIO_OS_SOLARIS_H |
| 2 | #define FIO_OS_SOLARIS_H |
| 3 | |
| 4 | #undef FIO_HAVE_LIBAIO |
| 5 | #define FIO_HAVE_POSIXAIO |
Jens Axboe | 417f006 | 2008-06-02 11:59:30 +0200 | [diff] [blame] | 6 | #define FIO_HAVE_SOLARISAIO |
Jens Axboe | 2c0ecd2 | 2006-06-08 13:25:41 +0200 | [diff] [blame] | 7 | #undef FIO_HAVE_FADVISE |
| 8 | #undef FIO_HAVE_CPU_AFFINITY |
| 9 | #undef FIO_HAVE_DISK_UTIL |
| 10 | #undef FIO_HAVE_SGIO |
| 11 | #undef FIO_HAVE_ODIRECT |
Jens Axboe | fffca02 | 2008-06-02 12:23:40 +0200 | [diff] [blame] | 12 | #define FIO_HAVE_FALLOCATE |
Jens Axboe | 207cb0f | 2008-06-02 12:28:02 +0200 | [diff] [blame^] | 13 | #define FIO_HAVE_POSIXAIO_FSYNC |
Jens Axboe | 2c0ecd2 | 2006-06-08 13:25:41 +0200 | [diff] [blame] | 14 | |
| 15 | #define OS_MAP_ANON (MAP_ANON) |
| 16 | |
| 17 | typedef unsigned long os_cpu_mask_t; |
| 18 | typedef unsigned int os_random_state_t; |
| 19 | |
| 20 | /* |
| 21 | * FIXME |
| 22 | */ |
| 23 | static inline int blockdev_size(int fd, unsigned long long *bytes) |
| 24 | { |
Jens Axboe | e5b401d | 2006-10-18 16:03:40 +0200 | [diff] [blame] | 25 | return EINVAL; |
| 26 | } |
| 27 | |
| 28 | static inline int blockdev_invalidate_cache(int fd) |
| 29 | { |
| 30 | return EINVAL; |
Jens Axboe | 2c0ecd2 | 2006-06-08 13:25:41 +0200 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | static inline unsigned long long os_phys_mem(void) |
| 34 | { |
| 35 | #if 0 |
| 36 | int mib[2] = { CTL_HW, HW_PHYSMEM }; |
| 37 | unsigned long long mem; |
| 38 | size_t len = sizeof(mem); |
| 39 | |
| 40 | sysctl(mib, 2, &mem, &len, NULL, 0); |
| 41 | return mem; |
| 42 | #else |
| 43 | return 0; |
| 44 | #endif |
| 45 | } |
| 46 | |
| 47 | static inline void os_random_seed(unsigned long seed, os_random_state_t *rs) |
| 48 | { |
| 49 | srand(seed); |
| 50 | } |
| 51 | |
| 52 | static inline long os_random_long(os_random_state_t *rs) |
| 53 | { |
| 54 | long val; |
| 55 | |
| 56 | val = rand_r(rs); |
| 57 | return val; |
| 58 | } |
| 59 | |
Jens Axboe | 2c0ecd2 | 2006-06-08 13:25:41 +0200 | [diff] [blame] | 60 | #endif |