OS headers need fio_file definition now
[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
e2e58886
JA
7#include "../file.h"
8
2afd826b
JA
9#ifndef CLOCK_MONOTONIC
10#define CLOCK_MONOTONIC 1
11#endif
12
13#ifndef CLOCK_REALTIME
14#define CLOCK_REALTIME 1
15#endif
16
17#define FIO_HAVE_POSIXAIO
ecc314ba 18#define FIO_HAVE_CLOCK_MONOTONIC
2afd826b 19#define FIO_USE_GENERIC_BDEV_SIZE
53531370 20#define FIO_USE_GENERIC_RAND
2afd826b
JA
21
22#define OS_MAP_ANON MAP_ANON
23
2afd826b 24typedef unsigned int clockid_t;
331539ac 25typedef off_t off64_t;
2afd826b 26
ecc314ba 27static inline int blockdev_invalidate_cache(struct fio_file fio_unused *f)
2afd826b
JA
28{
29 return EINVAL;
30}
31
32static inline unsigned long long os_phys_mem(void)
33{
34 int mib[2] = { CTL_HW, HW_PHYSMEM };
35 unsigned long long mem;
36 size_t len = sizeof(mem);
37
38 sysctl(mib, 2, &mem, &len, NULL, 0);
39 return mem;
40}
2afd826b 41#endif