client: fix mem leak
[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
d05c4a03 28#if BYTE_ORDER == BIG_ENDIAN
a9df7070 29#define FIO_BIG_ENDIAN
d05c4a03
JA
30#else
31#define FIO_LITTLE_ENDIAN
32#endif
33
a9df7070
JA
34#define FIO_USE_GENERIC_SWAP
35
d05c4a03
JA
36#define FIO_OS_HAVE_SOCKLEN_T
37#define fio_socklen_t socklen_t
38
9b836561 39static inline int blockdev_invalidate_cache(struct fio_file *f)
bf2e821a
CC
40{
41 return EINVAL;
42}
43
ecc314ba 44static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes)
bf2e821a
CC
45{
46 struct devinfo info;
47
ecc314ba 48 if (!ioctl(f->fd, IOCINFO, &info)) {
bf2e821a
CC
49 *bytes = (unsigned long long)info.un.scdk.numblks *
50 info.un.scdk.blksize;
51 return 0;
52 }
53
54 return errno;
55}
56
57static inline unsigned long long os_phys_mem(void)
58{
59 long mem = sysconf(_SC_AIX_REALMEM);
60
61 if (mem == -1)
62 return 0;
63
64 return (unsigned long long) mem * 1024;
65}
66
67#endif