eta.c verify.c memory.c io_u.c parse.c mutex.c options.c \
rbtree.c smalloc.c filehash.c profile.c debug.c lib/rand.c \
lib/num2str.c $(wildcard crc/*.c) engines/cpu.c \
- engines/mmap.c engines/sync.c engines/null.c engines/net.c \
- memalign.c
+ engines/mmap.c engines/sync.c engines/null.c memalign.c
ifeq ($(UNAME), Linux)
SOURCE += diskutil.c fifo.c blktrace.c helpers.c cgroup.c trim.c \
engines/libaio.c engines/posixaio.c engines/sg.c \
engines/splice.c engines/syslet-rw.c engines/guasi.c \
- engines/binject.c profiles/tiobench.c
+ engines/binject.c profiles/tiobench.c engines/net.c
LIBS += -lpthread -ldl -lrt -laio
CFLAGS += -rdynamic
endif
ifeq ($(UNAME), SunOS)
SOURCE += fifo.c lib/strsep.c helpers.c engines/posixaio.c \
- engines/solarisaio.c
+ engines/solarisaio.c engines/net.c
LIBS += -lpthread -ldl -laio -lrt -lnsl -lsocket
CPPFLAGS += -D__EXTENSIONS__
endif
ifeq ($(UNAME), FreeBSD)
- SOURCE += helpers.c engines/posixaio.c
+ SOURCE += helpers.c engines/posixaio.c engines/net.c
LIBS += -lpthread -lrt
CFLAGS += -rdynamic
endif
ifeq ($(UNAME), NetBSD)
- SOURCE += helpers.c engines/posixaio.c
+ SOURCE += helpers.c engines/posixaio.c engines/net.c
LIBS += -lpthread -lrt
CFLAGS += -rdynamic
endif
ifeq ($(UNAME), AIX)
- SOURCE += fifo.c helpers.c lib/getopt_long.c engines/posixaio.c
+ SOURCE += fifo.c helpers.c lib/getopt_long.c engines/posixaio.c engines/net.c
LIBS += -lpthread -ldl -lrt
CFLAGS += -rdynamic
CPPFLAGS += -D_LARGE_FILES -D__ppc__
endif
+ifeq ($(UNAME), HP-UX)
+ SOURCE += fifo.c helpers.c lib/getopt_long.c lib/strsep.c
+ LIBS += -lpthread -dl -lrt
+ CPPFLAGS += -D_LARGE_FILES
+endif
ifeq ($(UNAME), Darwin)
- SOURCE += helpers.c engines/posixaio.c
+ SOURCE += helpers.c engines/posixaio.c engines/net.c
LIBS += -lpthread -ldl
endif
ifneq (,$(findstring CYGWIN,$(UNAME)))
- SOURCE += engines/windowsaio.c
+ SOURCE += engines/windowsaio.c engines/net.c
LIBS += -lpthread -lrt
endif
#ifndef _AIX
+#ifndef __hpux
#include <getopt.h>
int getopt_long_only(int, char *const *, const char *, const struct option *, int *);
#endif /* _GETOPT_H */
+#endif /* __hpux */
#endif /* _AIX */
return 1;
}
- max_cpu = sysconf(_SC_NPROCESSORS_ONLN);
+ max_cpu = cpus_online();
for (i = 0; i < sizeof(int) * 8; i++) {
if ((1 << i) & *val) {
strip_blank_front(&str);
strip_blank_end(str);
- max_cpu = sysconf(_SC_NPROCESSORS_ONLN);
+ max_cpu = cpus_online();
while ((cpu = strsep(&str, ",")) != NULL) {
char *str2, *cpu2;
sprintf(buf, "%llu", mb_memory);
fio_keywords[1].replace = strdup(buf);
- l = sysconf(_SC_NPROCESSORS_ONLN);
+ l = cpus_online();
sprintf(buf, "%lu", l);
fio_keywords[2].replace = strdup(buf);
}
--- /dev/null
+#ifndef FIO_OS_HPUX_H
+#define FIO_OS_HPUX_H
+
+#include <errno.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <sys/fcntl.h>
+#include <sys/fadvise.h>
+#include <sys/mman.h>
+#include <sys/mpctl.h>
+
+#include "../file.h"
+
+#define FIO_HAVE_POSIXAIO
+#define FIO_HAVE_ODIRECT
+#define FIO_USE_GENERIC_RAND
+#define FIO_HAVE_CLOCK_MONOTONIC
+#define FIO_HAVE_PSHARED_MUTEX
+#define FIO_HAVE_FADVISE
+
+#define OS_MAP_ANON MAP_ANONYMOUS
+#define OS_MSG_DONTWAIT 0
+
+#define POSIX_MADV_DONTNEED MADV_DONTNEED
+#define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL
+#define POSIX_MADV_RANDOM MADV_RANDOM
+#define posix_madvise(ptr, sz, hint) madvise((ptr), (sz), (hint))
+
+static inline int blockdev_invalidate_cache(struct fio_file *f)
+{
+ return EINVAL;
+}
+
+static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes)
+{
+#if 0
+ struct devinfo info;
+
+ if (!ioctl(f->fd, IOCINFO, &info)) {
+ *bytes = (unsigned long long)info.un.scdk.numblks *
+ info.un.scdk.blksize;
+ return 0;
+ }
+
+ return errno;
+#else
+ return 0;
+#endif
+}
+
+static inline unsigned long long os_phys_mem(void)
+{
+#if 0
+ long mem = sysconf(_SC_AIX_REALMEM);
+
+ if (mem == -1)
+ return 0;
+
+ return (unsigned long long) mem * 1024;
+#else
+ return 0;
+#endif
+}
+
+#define FIO_HAVE_CPU_ONLINE_SYSCONF
+
+static inline unsigned int cpus_online(void)
+{
+ return mpctl(MPC_GETNUMSPUS, 0, NULL);
+}
+
+#endif
#include "os-mac.h"
#elif defined(_AIX)
#include "os-aix.h"
+#elif defined(__hpux)
+#include "os-hpux.h"
#elif defined(__CYGWIN__)
#include "os-windows.h"
#else
}
#endif
+#ifndef FIO_HAVE_CPU_ONLINE_SYSCONF
+static inline unsigned int cpus_online(void)
+{
+ return sysconf(_SC_NPROCESSORS_ONLN);
+}
+#endif
+
#endif