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 | |
10 | #define FIO_HAVE_FALLOCATE | |
11 | #define FIO_HAVE_ODIRECT | |
12 | #define FIO_USE_GENERIC_RAND | |
13 | ||
14 | #define FIO_HAVE_PSHARED_MUTEX | |
15 | ||
16 | #define OS_MAP_ANON MAP_ANON | |
17 | ||
18 | static inline int blockdev_invalidate_cache(int fd) | |
19 | { | |
20 | return EINVAL; | |
21 | } | |
22 | ||
23 | static inline int blockdev_size(int fd, unsigned long long *bytes) | |
24 | { | |
25 | struct devinfo info; | |
26 | ||
27 | if (!ioctl(fd, IOCINFO, &info)) { | |
28 | *bytes = (unsigned long long)info.un.scdk.numblks * | |
29 | info.un.scdk.blksize; | |
30 | return 0; | |
31 | } | |
32 | ||
33 | return errno; | |
34 | } | |
35 | ||
36 | static inline unsigned long long os_phys_mem(void) | |
37 | { | |
38 | long mem = sysconf(_SC_AIX_REALMEM); | |
39 | ||
40 | if (mem == -1) | |
41 | return 0; | |
42 | ||
43 | return (unsigned long long) mem * 1024; | |
44 | } | |
45 | ||
46 | #endif |