Jens Axboe | 2afd826 | 2009-12-14 23:08:42 +0100 | [diff] [blame] | 1 | #ifndef FIO_OS_APPLE_H |
| 2 | #define FIO_OS_APPLE_H |
| 3 | |
| 4 | #include <errno.h> |
| 5 | #include <sys/sysctl.h> |
| 6 | |
| 7 | #ifndef CLOCK_MONOTONIC |
| 8 | #define CLOCK_MONOTONIC 1 |
| 9 | #endif |
| 10 | |
| 11 | #ifndef CLOCK_REALTIME |
| 12 | #define CLOCK_REALTIME 1 |
| 13 | #endif |
| 14 | |
| 15 | #define FIO_HAVE_POSIXAIO |
| 16 | #define FIO_USE_GENERIC_BDEV_SIZE |
Jens Axboe | 5353137 | 2009-12-15 10:28:37 +0100 | [diff] [blame] | 17 | #define FIO_USE_GENERIC_RAND |
Jens Axboe | 2afd826 | 2009-12-14 23:08:42 +0100 | [diff] [blame] | 18 | |
| 19 | #define OS_MAP_ANON MAP_ANON |
| 20 | |
| 21 | typedef unsigned long os_cpu_mask_t; |
Jens Axboe | 2afd826 | 2009-12-14 23:08:42 +0100 | [diff] [blame] | 22 | typedef unsigned int clockid_t; |
Jens Axboe | 331539a | 2010-03-19 21:31:01 +0100 | [diff] [blame^] | 23 | typedef off_t off64_t; |
Jens Axboe | 2afd826 | 2009-12-14 23:08:42 +0100 | [diff] [blame] | 24 | |
| 25 | static inline int blockdev_invalidate_cache(int fd) |
| 26 | { |
| 27 | return EINVAL; |
| 28 | } |
| 29 | |
| 30 | static inline unsigned long long os_phys_mem(void) |
| 31 | { |
| 32 | int mib[2] = { CTL_HW, HW_PHYSMEM }; |
| 33 | unsigned long long mem; |
| 34 | size_t len = sizeof(mem); |
| 35 | |
| 36 | sysctl(mib, 2, &mem, &len, NULL, 0); |
| 37 | return mem; |
| 38 | } |
Jens Axboe | 2afd826 | 2009-12-14 23:08:42 +0100 | [diff] [blame] | 39 | #endif |