Commit | Line | Data |
---|---|---|
bf2e821a CC |
1 | #ifndef FIO_OS_AIX_H |
2 | #define FIO_OS_AIX_H | |
3 | ||
4 | #include <errno.h> | |
5 | #include <unistd.h> | |
6 | #include <sys/devinfo.h> | |
7 | #include <sys/ioctl.h> | |
8 | ||
9 | #define FIO_HAVE_POSIXAIO | |
bf2e821a CC |
10 | #define FIO_HAVE_ODIRECT |
11 | #define FIO_USE_GENERIC_RAND | |
12 | ||
13 | #define FIO_HAVE_PSHARED_MUTEX | |
14 | ||
15 | #define OS_MAP_ANON MAP_ANON | |
16 | ||
17 | static inline int blockdev_invalidate_cache(int fd) | |
18 | { | |
19 | return EINVAL; | |
20 | } | |
21 | ||
22 | static inline int blockdev_size(int fd, unsigned long long *bytes) | |
23 | { | |
24 | struct devinfo info; | |
25 | ||
26 | if (!ioctl(fd, IOCINFO, &info)) { | |
27 | *bytes = (unsigned long long)info.un.scdk.numblks * | |
28 | info.un.scdk.blksize; | |
29 | return 0; | |
30 | } | |
31 | ||
32 | return errno; | |
33 | } | |
34 | ||
35 | static inline unsigned long long os_phys_mem(void) | |
36 | { | |
37 | long mem = sysconf(_SC_AIX_REALMEM); | |
38 | ||
39 | if (mem == -1) | |
40 | return 0; | |
41 | ||
42 | return (unsigned long long) mem * 1024; | |
43 | } | |
44 | ||
45 | #endif |