#include "os-freebsd.h"
#elif defined(__sun__)
#include "os-solaris.h"
+#elif defined(__APPLE__)
+#include "os-mac.h"
#else
#error "unsupported os"
#endif
#endif /* FIO_HAVE_FADVISE */
#ifndef FIO_HAVE_CPU_AFFINITY
-#define fio_setaffinity(td) (0)
+#define fio_setaffinity(pid, mask) (0)
#define fio_getaffinity(pid, mask) do { } while (0)
#define fio_cpu_clear(mask, cpu) do { } while (0)
#define fio_cpuset_exit(mask) (-1)
#endif
}
+#ifdef FIO_USE_GENERIC_BDEV_SIZE
+static inline int blockdev_size(int fd, unsigned long long *bytes)
+{
+ off_t end;
+
+ *bytes = 0;
+
+ end = lseek(fd, 0, SEEK_END);
+ if (end < 0)
+ return errno;
+
+ *bytes = end;
+ return 0;
+}
+#endif
+
#endif