Fix FreeBSD warning
[fio.git] / os / os-mac.h
CommitLineData
2afd826b
JA
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
53531370 17#define FIO_USE_GENERIC_RAND
2afd826b
JA
18
19#define OS_MAP_ANON MAP_ANON
20
2afd826b 21typedef unsigned int clockid_t;
331539ac 22typedef off_t off64_t;
2afd826b
JA
23
24static inline int blockdev_invalidate_cache(int fd)
25{
26 return EINVAL;
27}
28
29static inline unsigned long long os_phys_mem(void)
30{
31 int mib[2] = { CTL_HW, HW_PHYSMEM };
32 unsigned long long mem;
33 size_t len = sizeof(mem);
34
35 sysctl(mib, 2, &mem, &len, NULL, 0);
36 return mem;
37}
2afd826b 38#endif