[PATCH] Get closer to FreeBSD compile
[fio.git] / os-freebsd.h
index 26dba908fa9e79456b9ca98ea20ae50109e4b6d0..31fa01071aaf283410a4059bcd40cdb670cd8268 100644 (file)
@@ -15,9 +15,19 @@ typedef unsigned long os_cpu_mask_t;
 /*
  * FIXME
  */
-static inline int blockdev_size(int fd, size_t *bytes)
+static inline int blockdev_size(int fd, unsigned long long *bytes)
 {
        return 1;
 }
 
+static inline unsigned long long os_phys_mem(void)
+{
+       int mib[2] = { CTL_HW, HW_PHYSMEM };
+       unsigned long long mem;
+       size_t len = sizeof(mem);
+
+       sysctl(mib, 2, &mem, &len, NULL, 0);
+       return mem;
+}
+
 #endif