8 #include <sys/fadvise.h>
10 #include <sys/mpctl.h>
12 #include <sys/param.h>
13 #include <sys/pstat.h>
19 #define FIO_HAVE_POSIXAIO
20 #define FIO_HAVE_ODIRECT
21 #define FIO_USE_GENERIC_RAND
22 #define FIO_HAVE_CLOCK_MONOTONIC
23 #define FIO_HAVE_PSHARED_MUTEX
24 #define FIO_HAVE_FADVISE
26 #define OS_MAP_ANON MAP_ANONYMOUS
27 #define OS_MSG_DONTWAIT 0
29 #define POSIX_MADV_DONTNEED MADV_DONTNEED
30 #define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL
31 #define POSIX_MADV_RANDOM MADV_RANDOM
32 #define posix_madvise(ptr, sz, hint) madvise((ptr), (sz), (hint))
34 #ifndef CLOCK_MONOTONIC
35 #define CLOCK_MONOTONIC CLOCK_REALTIME
39 #define MSG_WAITALL 0x40
42 static inline int blockdev_invalidate_cache(struct fio_file *f)
47 static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes)
51 if (!ioctl(f->fd, SIOC_CAPACITY, &cap) == -1) {
52 *bytes = cap.lba * cap.blksz;
60 static inline unsigned long long os_phys_mem(void)
62 unsigned long long ret;
63 struct pst_static pst;
67 if (pstat(PSTAT_STATIC, pu, sizeof(pst), 0, 0) == -1)
70 ret = pst.physical_memory;
75 #define FIO_HAVE_CPU_ONLINE_SYSCONF
77 static inline unsigned int cpus_online(void)
79 return mpctl(MPC_GETNUMSPUS, 0, NULL);