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