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 | |
ecc314ba | 12 | #define FIO_HAVE_CLOCK_MONOTONIC |
bf2e821a | 13 | |
282cc167 JA |
14 | /* |
15 | * This is broken on AIX if _LARGE_FILES is defined... | |
16 | */ | |
17 | #if 0 | |
18 | #define FIO_HAVE_FALLOCATE | |
19 | #endif | |
20 | ||
bf2e821a CC |
21 | #define FIO_HAVE_PSHARED_MUTEX |
22 | ||
23 | #define OS_MAP_ANON MAP_ANON | |
8e239cae | 24 | #define OS_MSG_DONTWAIT 0 |
bf2e821a | 25 | |
ecc314ba | 26 | static inline int blockdev_invalidate_cache(struct fio_file fio_unused *f) |
bf2e821a CC |
27 | { |
28 | return EINVAL; | |
29 | } | |
30 | ||
ecc314ba | 31 | static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes) |
bf2e821a CC |
32 | { |
33 | struct devinfo info; | |
34 | ||
ecc314ba | 35 | if (!ioctl(f->fd, IOCINFO, &info)) { |
bf2e821a CC |
36 | *bytes = (unsigned long long)info.un.scdk.numblks * |
37 | info.un.scdk.blksize; | |
38 | return 0; | |
39 | } | |
40 | ||
41 | return errno; | |
42 | } | |
43 | ||
44 | static inline unsigned long long os_phys_mem(void) | |
45 | { | |
46 | long mem = sysconf(_SC_AIX_REALMEM); | |
47 | ||
48 | if (mem == -1) | |
49 | return 0; | |
50 | ||
51 | return (unsigned long long) mem * 1024; | |
52 | } | |
53 | ||
54 | #endif |