• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef FIO_OS_AIX_H
2 #define FIO_OS_AIX_H
3 
4 #define	FIO_OS	os_aix
5 
6 #include <errno.h>
7 #include <unistd.h>
8 #include <sys/devinfo.h>
9 #include <sys/ioctl.h>
10 
11 #include "../file.h"
12 
13 #define FIO_HAVE_ODIRECT
14 #define FIO_USE_GENERIC_RAND
15 #define FIO_USE_GENERIC_INIT_RANDOM_STATE
16 
17 #define OS_MAP_ANON		MAP_ANON
18 #define OS_MSG_DONTWAIT		0
19 
20 #define FIO_USE_GENERIC_SWAP
21 
blockdev_invalidate_cache(struct fio_file * f)22 static inline int blockdev_invalidate_cache(struct fio_file *f)
23 {
24 	return ENOTSUP;
25 }
26 
blockdev_size(struct fio_file * f,unsigned long long * bytes)27 static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes)
28 {
29 	struct devinfo info;
30 
31 	if (!ioctl(f->fd, IOCINFO, &info)) {
32         	*bytes = (unsigned long long)info.un.scdk.numblks *
33 				info.un.scdk.blksize;
34 		return 0;
35 	}
36 
37 	return errno;
38 }
39 
os_phys_mem(void)40 static inline unsigned long long os_phys_mem(void)
41 {
42 	long mem = sysconf(_SC_AIX_REALMEM);
43 
44 	if (mem == -1)
45 		return 0;
46 
47 	return (unsigned long long) mem * 1024;
48 }
49 
50 #endif
51