os-aix.h revision 8e239cae8aae89f07a885ffcc985600ce9c65d5d
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_ODIRECT
11#define FIO_USE_GENERIC_RAND
12
13#define FIO_HAVE_PSHARED_MUTEX
14
15#define OS_MAP_ANON		MAP_ANON
16#define OS_MSG_DONTWAIT		0
17
18static inline int blockdev_invalidate_cache(int fd)
19{
20	return EINVAL;
21}
22
23static 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
36static 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
47