summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2008-06-04 20:13:04 +0200
committerJens Axboe <jens.axboe@oracle.com>2008-06-04 20:13:04 +0200
commitdc873b6f4a536c332b72cce268d5a7ccd356a891 (patch)
treeba42b3db0ebbcffad2c90afe194edd159f953632 /os
parentda28353c3fb45a8a6ee00d1133efd483c0ae684c (diff)
downloadfio-dc873b6f4a536c332b72cce268d5a7ccd356a891.tar.gz
fio-dc873b6f4a536c332b72cce268d5a7ccd356a891.tar.bz2
Add OS agnostic RAND_MAX
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'os')
-rw-r--r--os/os-freebsd.h2
-rw-r--r--os/os-linux.h2
-rw-r--r--os/os-solaris.h3
-rw-r--r--os/os.h4
4 files changed, 8 insertions, 3 deletions
diff --git a/os/os-freebsd.h b/os/os-freebsd.h
index af5fc9f6..614296a4 100644
--- a/os/os-freebsd.h
+++ b/os/os-freebsd.h
@@ -6,7 +6,7 @@
#define FIO_HAVE_POSIXAIO
#define FIO_HAVE_ODIRECT
-#define OS_MAP_ANON (MAP_ANON)
+#define OS_MAP_ANON MAP_ANON
typedef unsigned long os_cpu_mask_t;
typedef unsigned int os_random_state_t;
diff --git a/os/os-linux.h b/os/os-linux.h
index a07db06b..72950c0e 100644
--- a/os/os-linux.h
+++ b/os/os-linux.h
@@ -29,7 +29,7 @@
#define FIO_HAVE_FALLOCATE
#define FIO_HAVE_POSIXAIO_FSYNC
-#define OS_MAP_ANON (MAP_ANONYMOUS)
+#define OS_MAP_ANON MAP_ANONYMOUS
#ifndef CLOCK_MONOTONIC
#define CLOCK_MONOTONIC 1
diff --git a/os/os-solaris.h b/os/os-solaris.h
index 9e243e8a..759f3c1b 100644
--- a/os/os-solaris.h
+++ b/os/os-solaris.h
@@ -9,7 +9,8 @@
#define FIO_HAVE_FALLOCATE
#define FIO_HAVE_POSIXAIO_FSYNC
-#define OS_MAP_ANON (MAP_ANON)
+#define OS_MAP_ANON MAP_ANON
+#define OS_RAND_MAX 2147483648UL
struct solaris_rand_seed {
unsigned short r[3];
diff --git a/os/os.h b/os/os.h
index 2dfed5e2..1cff4945 100644
--- a/os/os.h
+++ b/os/os.h
@@ -68,6 +68,10 @@
#define FIO_O_NOATIME 0
#endif
+#ifndef OS_RAND_MAX
+#define OS_RAND_MAX RAND_MAX
+#endif
+
#ifndef FIO_HAVE_RAWBIND
#define fio_lookup_raw(dev, majdev, mindev) 1
#endif