summaryrefslogtreecommitdiff
path: root/os/os-aix.h
diff options
context:
space:
mode:
authorCigy Cyriac <CCyriac@fusionio.com>2010-08-10 19:51:11 -0400
committerJens Axboe <jaxboe@fusionio.com>2010-08-10 19:51:11 -0400
commitbf2e821a55d8aa3de1cda7288a0e22883110fdc6 (patch)
tree5f2b5af2154aec6e35e1940152ece0beb87b05ad /os/os-aix.h
parentf5886fef7eb0c44ec854d00a70acc0dfc4975efa (diff)
downloadfio-bf2e821a55d8aa3de1cda7288a0e22883110fdc6.tar.gz
fio-bf2e821a55d8aa3de1cda7288a0e22883110fdc6.tar.bz2
Add support for AIX
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'os/os-aix.h')
-rw-r--r--os/os-aix.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/os/os-aix.h b/os/os-aix.h
new file mode 100644
index 00000000..1cc35e86
--- /dev/null
+++ b/os/os-aix.h
@@ -0,0 +1,46 @@
+#ifndef FIO_OS_AIX_H
+#define FIO_OS_AIX_H
+
+#include <errno.h>
+#include <unistd.h>
+#include <sys/devinfo.h>
+#include <sys/ioctl.h>
+
+#define FIO_HAVE_POSIXAIO
+#define FIO_HAVE_FALLOCATE
+#define FIO_HAVE_ODIRECT
+#define FIO_USE_GENERIC_RAND
+
+#define FIO_HAVE_PSHARED_MUTEX
+
+#define OS_MAP_ANON MAP_ANON
+
+static inline int blockdev_invalidate_cache(int fd)
+{
+ return EINVAL;
+}
+
+static inline int blockdev_size(int fd, unsigned long long *bytes)
+{
+ struct devinfo info;
+
+ if (!ioctl(fd, IOCINFO, &info)) {
+ *bytes = (unsigned long long)info.un.scdk.numblks *
+ info.un.scdk.blksize;
+ return 0;
+ }
+
+ return errno;
+}
+
+static inline unsigned long long os_phys_mem(void)
+{
+ long mem = sysconf(_SC_AIX_REALMEM);
+
+ if (mem == -1)
+ return 0;
+
+ return (unsigned long long) mem * 1024;
+}
+
+#endif