android: add byteorder for the swab routines
[fio.git] / os / os-aix.h
CommitLineData
bf2e821a
CC
1#ifndef FIO_OS_AIX_H
2#define FIO_OS_AIX_H
3
cca84643
JA
4#define FIO_OS os_aix
5
bf2e821a
CC
6#include <errno.h>
7#include <unistd.h>
8#include <sys/devinfo.h>
9#include <sys/ioctl.h>
10
e2e58886
JA
11#include "../file.h"
12
bf2e821a
CC
13#define FIO_HAVE_ODIRECT
14#define FIO_USE_GENERIC_RAND
93bcfd20 15#define FIO_USE_GENERIC_INIT_RANDOM_STATE
282cc167 16
bf2e821a
CC
17#define FIO_HAVE_PSHARED_MUTEX
18
19#define OS_MAP_ANON MAP_ANON
8e239cae 20#define OS_MSG_DONTWAIT 0
bf2e821a 21
a9df7070
JA
22#define FIO_USE_GENERIC_SWAP
23
9b836561 24static inline int blockdev_invalidate_cache(struct fio_file *f)
bf2e821a
CC
25{
26 return EINVAL;
27}
28
ecc314ba 29static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes)
bf2e821a
CC
30{
31 struct devinfo info;
32
ecc314ba 33 if (!ioctl(f->fd, IOCINFO, &info)) {
bf2e821a
CC
34 *bytes = (unsigned long long)info.un.scdk.numblks *
35 info.un.scdk.blksize;
36 return 0;
37 }
38
39 return errno;
40}
41
42static inline unsigned long long os_phys_mem(void)
43{
44 long mem = sysconf(_SC_AIX_REALMEM);
45
46 if (mem == -1)
47 return 0;
48
49 return (unsigned long long) mem * 1024;
50}
51
52#endif